Top stories
Bun's runtime rewritten from Zig to Rust with agentic tooling
- Category: Agentic coding
- Status: confirmed
- Sources: Bun blog, Simon Willison, HN discussion
- Summary: Bun published an account on 2026-07-08 of rewriting its runtime, about 535,000 lines including the transpiler, package manager, test runner, and Node.js API implementations, from Zig to Rust. The stated motivation is memory-safety bugs (use-after-free, double-free, leaks) from mixing garbage-collected JavaScript values with manually managed memory, which Rust's compiler rejects at build time. Bun reports the work ran May 3 to 14, 2026 with many parallel Claude Code instances (about 6,500 commits, up to 64 instances at peak) using adversarial code-review loops, and claims 2 to 5 percent higher throughput, roughly 20 percent smaller binaries on Linux and Windows, and fixed leaks. The Rust port merged to main, ships in the Bun 1.4.0 canary, and Bun states Claude Code v2.1.181 and later already use it. Bun 1.3.14 was the final Zig release.
- Comments: HN commenters attribute the rewrite to Anthropic's Fable 5 model and frame the post partly as a capability demonstration. One notes it reflects poorly on Zig that a largely mechanical rewrite fixed leaks, shrank binaries, and improved performance.
- Why it matters: A production JavaScript runtime replacing its implementation language largely through parallel agent runs is a concrete data point on the scope of AI-assisted rewrites, and it changes the toolchain under Claude Code.
- Follow-up: Watch Bun 1.4.0 stable, regression reports from the Rust port, and independent confirmation of the performance and stability claims.