Compile JavaScript to a native executable
Quench's AOT compiler turns a JavaScript or TypeScript program into machine code, not a bundled script.
Quench compiles a JavaScript or TypeScript entry file and its imports ahead of time into one native executable: quench --build-aot app.ts -o app. The program is lowered to machine code with the same meaning as Quench's interpreter; the full interpreter and JITs are left out unless the program uses eval or new Function. AOT is experimental and no AOT speed numbers are published yet.
Usage
cargo build --release -p quench --features aot
./target/release/quench --build-aot app.ts -o app
./app
How it compares
| Quench AOT | Node.js SEA | bun build --compile | deno compile | |
|---|---|---|---|---|
| What goes into the binary | program compiled to machine code, plus runtime | script embedded in the node binary | bundle embedded in the Bun binary | program embedded in the Deno binary |
| Code runs as | precompiled native code | V8 interpreter and JIT at run time | JavaScriptCore at run time | V8 at run time |
| Full interpreter in the binary | only if eval or new Function is used | always | always | always |
| Published speed numbers | not measured | not measured | not measured | not measured |
| Maturity | experimental, build from source | stable | stable | stable |
Quench has not benchmarked its AOT output against these tools, so this table describes mechanism only.
One semantics
Each opcode's meaning is written once. The interpreter runs it directly, the JITs and the AOT compiler emit it as machine code. That is the interpreter specialized to what is known about the program (a Futamura projection), so an AOT-compiled program and an interpreted one agree. Background: AOT without a second compiler.
Limits today
- Built and tested on Linux, from a source build with
--features aot. - No published speed numbers; the target is within 5x of equivalent C on every JetStream benchmark.
- Node API compatibility is still being built out.
The runtime around it
| Quench | Node.js | Bun | Deno | |
|---|---|---|---|---|
| Written in | Rust (engine and runtime) | C++ (V8) and JavaScript | Zig, C++ (JavaScriptCore) | Rust runtime, C++ engine (V8) |
| V8-v7 score, JIT off, geomean of 8 | 4,980 | 2,349 | 1,979 | not measured |
| V8-v7 peak memory, JIT off, geomean | 11.4 MB | 65.4 MB | 26.8 MB | not measured |
| JetStream 3 score, JIT off, 56 tests | 34.3 | 39.7 | 32.2 | not measured |
| JetStream 3 peak memory, JIT off | 28.5 MB | 110.1 MB | 47.7 MB | not measured |
| Test262 | 53,353 passing, 0 failing, 53 waived | not measured | not measured | not measured |
| JIT performance | JIT tiers not yet competitive | mature JIT | mature JIT | mature JIT (V8) |
| Packaged releases | no, build from source | yes | yes | yes |
Benchmark rows: interpreter only in every engine (quench --no-jit, node --jitless, Bun with BUN_JSC_useJIT=0), one 4-core Linux machine. V8-v7 measured 14 November 2026, JetStream 3 on 17 November 2026. Bold marks the best measured value. Deno has not been measured; we do not publish numbers we have not run. Full tables and method.
Questions
How do I compile JavaScript or TypeScript to a native executable?
With Quench built with the aot feature, run quench --build-aot app.ts -o app, then ./app. The entry file and the modules it imports are compiled ahead of time into one native executable.
Is the Quench AOT compiler faster than Node?
No AOT speed numbers are published yet. The goal is AOT code within 5x of the equivalent C program, and it is not yet met on every benchmark.
Does an AOT-compiled Quench program include an interpreter?
The full interpreter and the JIT tiers are left out of the executable unless the program uses eval or new Function, which need to compile code at run time.
About Quench
Quench is a JavaScript, TypeScript and WebAssembly runtime written in Rust. Test262: 53,353 passing, 0 failing. Interpreter, two JITs, and AOT to native executables. It is MIT licensed, early, and built from source with Cargo. Source: github.com/butaji/quench. Machine-readable summary: llms.txt.
Related: benchmarks · JavaScript runtime in Rust · low-memory Node.js alternative · compile JavaScript to a native executable · Test262 conformance · JavaScript for AI agents