bamTiScript is a pre-release Rust toolchain that type-checks and compiles TypeScript. TypeScript 7.0.2 compatibility is in progress.
- Repository:
bamTiScript - CLI binary:
bamts - Workspace crates:
bamts,bamts-cli,bamts-compiler,bamts-cancel,bamts-bytecode,bamts-runtime,bamts-codegen,bamts-native,bamts-node,bamts-verification, and privatebamts-napi - npm packages:
bamti(in-process Node 24+ interface) andbamti-cli(standalone CLI transport). Currently published 0.1.0 packages on npm do not provide native binary artifacts; the source implementation of Node-API bindings is not yet published.
Build the CLI from source, create a TypeScript entrypoint, type-check it, and emit a native host executable:
cargo build --release -p bamts-cli
cat > hello.ts <<'EOF'
const message: string = "hello from bamts";
process.stdout.write(`${message}\n`);
EOF
target/release/bamts --noEmit --pretty false hello.ts
target/release/bamts hello.ts --outDir out
./out/hello- Version
0.2.0is pre-release. bamtiprovides an in-process Node 24+ interface backed by native Node-API bindings (bamts-napi) and atomic cancellation (bamts-cancel), whilebamti-cliis the standalone CLI transport.- The native addon design targets five host platform packages (
@bamti/bamti-linux-x64-gnu,@bamti/bamti-linux-arm64-gnu,@bamti/bamti-darwin-x64,@bamti/bamti-darwin-arm64,@bamti/bamti-win32-x64-msvc) with fail-closed optional artifact loading. - Currently published 0.1.0 npm packages do not contain prebuilt native binary artifacts. Real five-target release validation remains blocked by GitHub billing and is unverified. Build the working CLI from source with Cargo on Linux x64.
- The documented host runtime target is Linux x64. Direct
bamts <file> --outDircompilation writes a native host executable;--declarationand--sourceMapon that path fail closed (TS5047).
- Type checking through the TypeScript-compatible
--noEmitcommand line - Native host executable output through
--outDiron a direct source-file invocation (Linux x64) - Project configuration and build mode through
tsconfig.json,--project, and--build - UTF-16 code-unit indexing for ECMAScript strings
- In-process Node.js 24+ interface via native Node-API bindings (
bamts-napi) with atomic cancellation control (bamts-cancel) - A limited Node-style host surface that includes
process.stdout.write
- TypeScript 7.0.2 is the compatibility oracle and target, not a completed compatibility claim.
- The public CLI follows the TypeScript 7.0.2
tscargument model. The previouscheck,run,compile,explain,--target jit, and--target aotforms are not public CLI commands. bamtirequires Node.js 24 or later. Currently published0.1.0npm packages do not contain compiled native artifacts; the source-tree native addon implementation is unpublished.bamtioptional native package loading is fail-closed. Real five-target runtime release verification is blocked by GitHub billing and has not passed.- The host runtime implements a limited Node-style API surface. It does not provide full Node.js compatibility.
--target jitand--target aotare not public CLI flags. Direct compilation still emits a native host executable through--outDir; it does not emit JavaScript, declaration files, or source maps.- The root workspace policy defaults to
unsafe_code = "forbid". Most crates inherit it. Native code generation, host export, verification, FFI, and privatebamts-napicrates contain narrowly scoped, documented exceptions. This policy is not an end-to-end formal memory-safety guarantee. - The project publishes no performance benchmark or production-readiness claim.
- Formal source artifacts target named properties. The current acceptance state is recorded in the proof ledger; complete compiler and runtime correctness is not proven.
- Quickstart Guide: Step-by-step source build, type-check, and native executable emission tutorial.
- CLI Reference: TypeScript-compatible command flags, project mode, build mode, and exit codes.
- Diagnostics Reference: Diagnostic codes, output formats, UTF-16 column indexing, and error limits.
- Architecture Explanation: High-level system architecture and component boundaries.
- Verification Explanation: Conformance testing, differential corpus, and formal verification models.
- Compiler Rules: Type checker invariants and diagnostic rules.
- UTF-16 String Encoding Pattern: UTF-16 string representation and runtime design.
See CONTRIBUTING.md for local environment setup (Rust 1.97.1, Edition 2024) and mandatory unpiped validation gates:
cargo fmt --all --check
cargo check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspaceEvery commit must implement one logical concern and compile cleanly.
Distributed under the MIT License.
