An early preview of experimental Bun + JSC with ahead-of-time compilation For Claude Code's CLI: 24% faster startup, 48% lower memory, 46% lower CPU, and nearly 2x larger binary size
69
62
1,300
84,557
Most JavaScript usage is just-in-time compiled. As code runs, types of values are watched and when a function runs frequently enough, a faster specialized version of that function is compiled on-demand. Ahead of time compilation bakes that work into the executable itself.
1
1
141
9,300
The cost of ahead-of-time compilation is less information about the types is available. In native languages like Rust or Go, numbers specify double or int, a sign, and a size. TypeScript is more flexible and less specific, which makes performance optimizations harder.
6
1
112
7,629
In this prototype, a limited amount of TypeScript syntax is used to propagate type information.

Sep 29, 2026 · 1:18 AM UTC

2
1
68
5,896
Generally, ahead of time compilation results in slower peak JavaScript execution than just-in-time compilation. We think a stricter flavor of TypeScript and locking down modifications to builtins like Array & Object can close most of the gap.
3
72
9,015
There are a lot of optimizations that aren’t implemented yet. I want the binary size growth to go down a lot more (it started at 1 GB). It needs to support sized types like uint32_t and propagate more detailed types. There’s no separate checker to run and no diagnostics
3
50
6,107
AoT uses Bun’s bundler & parser to parse typescript, tags types to JavaScriptCore via a typecheck bytecode intrinsic, and compiles the bytecode to machine code via B3 (what JSC’s JITs use) This keeps the JavaScriptCore changes well-contained, so that syncing with upstream WebKit isn’t complicated
1
56
5,678
Sort replies: Relevant Recent Liked