Jarred Sumner
@jarredsumner
this was my 3rd attempt at Bun AOT.
the first two were before bun check, and performed worse than the JIT.
it used bytecode instead of typescript types. binaries were sometimes 1 GB lol
trying attempt 4 now. doesn’t work yet
JJarred SumnerXView on Xbig draft pr
In the next version of Bun
bun check gets 1.7x - 7x faster
big draft pr
Here's a little how Bun AOT currently works (and may still change a lot):
- bun build --compile --aot
bun checktype-checks but allows untyped code- Typed IR
- Optimization passes
- JavaScriptCore's B3 compiler runs
- ARM64/x64 machine code
(continued)
Many people were saying Bun was dead after the acquisition.
Then again after the Rust rewrite
We’re having fun proving them wrong
ZZerionXView on X@bunjavascript I thought Bun would go the same way after being acquired by Anthropic, just like Deno killed itself. But then they released Bun 1.4, and after seeing all those crazy improvements..
cool project.
I want to see more experiments with ahead of time compilation for TypeScript-like languages
RRichieXView on XWow. https://tov.sh/ is already faster than Rust and Bun in lots of cases. Smaller binary, memory/CPU usage, faster build times.
I’ve only worked on it for ~1 day 😳 imagine 1 week!
Also built a x264 encoder replacement for @Cap, using Tov, and it is up to 8.1x faster.
Bun AoT is starting to get good
TypeScript 6 built with Bun AoT typechecks Effect slightly faster than TypeScript 7 when single-threaded.
Today, Bun is a:
- Node-compatible JavaScript runtime
- npm-compatible package manager
- jest-compatible test runner
- esbuild-compatible bundler
Next week, Bun gets 3 more tools on that list.
BBunXView on XBun v1.5 ships on Wednesday
The plan: use this to give ahead of time compiled JavaScript & TypeScript a real shot at beating Go & other compiled languages’s perf
Don’t know yet how that’ll play out
BBunXView on XIn the next version of Bun
bun checkis a TypeScript type checker builtin to Bun (written in Rust)
The first step is types.
We're adding a TypeScript-compatible type checker to Bun.
It’s the best shot ahead-of-time compiled TypeScript has at beating languages like Go on memory and speed.
JJarred SumnerXView on XJavaScript was never designed for the server. If that doesn't change soon, JavaScript on the server will be replaced by Rust.
The fix needs to happen in the engine. Sound types. Ahead-of-time compilation. Threads with shared objects.
More AoT numbers
also: claude code is 304 MB now instead of 430 MB
JJarred SumnerXView on XAn 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