Rewriting Bun in Rust
dev_tools
According to Simon Willison's Weblog, the JavaScript runtime Bun has been quietly rewritten from the Zig language to Rust — and it was largely done by coding agents. Creator Jarred Sumner explained that Bun's hardest bugs were memory errors like use-after-free and double-free, the kind Rust turns into compiler errors. Conventional wisdom, going back to Joel Spolsky's famous essay, says you should never stop and rewrite a large codebase from scratch. Willison's point is that frontier models change that math. The key enabler was Bun's TypeScript test suite, which acted as a language-independent conformance check with a million assertions, letting an agent harness automate most of the port. Rather than hand-fixing bugs, Sumner fixed the process generating the code, and reviewed a pull request adding over one million lines. The Rust version has shipped inside Claude Code since mid-June, cutting Linux startup time by about ten percent with almost no one noticing. The estimated cost, at standard API pricing, was around one hundred sixty-five thousand dollars in tokens.
Source: https://simonwillison.net/2026/Jul/8/rewriting-bun-in-rus...
Listen to this story
Hear this and more stories in a personalized audio briefing.
Open The Chonkerton