Free · open source
GPLv3, royalty-free or commercial — your choice$0forever
- ts and js modes
- stator explain verdicts
- vite-stator bundler for js mode
TypeScript and JavaScript to native binaries — an ahead-of-time compiler where typed code becomes unboxed machine values.
mise install && pnpm install --frozen-lockfile && pnpm run runtime

See it run
$ node packages/compiler/src/cli/main.ts build app.ts -o app $ node packages/compiler/src/cli/main.ts build app.js -o app --mode=js $ node packages/compiler/src/cli/main.ts explain app.ts --json
Overview
Stator is an ahead-of-time compiler from TypeScript and JavaScript to native binaries.
Typed code compiles to unboxed machine values. Untyped code compiles too, through a dynamic representation (NaN-boxed values, shape tables, inline caches), instead of being rejected or heroically analyzed. One pipeline; the mode is a policy layer on top.
Stator is a research compiler under active construction. It is not an npm-ecosystem drop-in, and it is not a production JS runtime.
Features
--mode=ts (the default) takes .ts only and makes any, eval, var and Proxy compile errors; --mode=js takes .js and .ts mixed and compiles untyped code as dynamic.
Inside checked code, values compile to machine values wherever the checker can infer a type.
stator explain reports a per-construct verdict: static, dynamic, error or not-yet.
vite-stator bundles node_modules into one tree-shaken module, and its stator() Vite plugin makes vite build write the native binary.
Every option can live in stator.config.json, validated against a generated JSON Schema; the command line overrides it.
An extern surface with an ABI table and explicit ownership rules for FFI.
Install
There is no release yet. Set up the pinned toolchain (Node, pnpm, LLVM clang, just) and build the runtime from a checkout:
git clone https://github.com/pyrlyn/stator
cd stator
mise install
pnpm install --frozen-lockfile
pnpm run runtime
Build a native binary from TypeScript, straight from the sources on the pinned Node.
node packages/compiler/src/cli/main.ts build app.ts -o app
More examples below.
Usage examples
Compile mixed JavaScript in js mode.
node packages/compiler/src/cli/main.ts build app.js -o app --mode=js
Ask what each construct compiles to.
node packages/compiler/src/cli/main.ts explain app.ts --json
Links
You can use Stator under any of the following licenses, at your choice:
Pricing
Pro is a placeholder$0forever
$9 / moper seat
Placeholder — the Pro waitlist is not open yet.
Free and open source. Star it, file an issue, or send a pull request.