#Rust

Bun Rewritten from Zig to Rust

simonwillison.net · ⭐️ 8/10 · 2026-07-09

8/10

Jarred Sumner announced the successful rewrite of the Bun JavaScript runtime from Zig to Rust, a process that took 11 days of intensive agentic engineering using Claude and cost approximately $165,000 in API tokens. This rewrite demonstrates that modern AI coding agents can make large-scale rewrites feasible, challenging the long-held 'never rewrite' wisdom. It also shows how Rust's memory safety can eliminate common bugs like use-after-free that plagued Zig's manual memory management. The Bun test suite, written in TypeScript, served as a conformance suite to validate the port. The new Rust-based Bun has been running in Claude Code since June 17, 2026, with 10% faster startup on Linux and no noticeable changes for users.

Rust 1.97.0 introduces a new default symbol-mangling scheme, enables denying Cargo warnings via a new flag, and stops hiding linker output after a successful build. These changes improve build reliability and debugging for Rust developers. Denying warnings can help enforce code quality in CI pipelines, while the new mangling scheme ensures more stable symbol names. The new symbol-mangling scheme produces more consistent symbol names across different Rust versions. The Cargo deny warnings feature allows treating warnings as errors, similar to -D warnings in rustc. Removal of hidden linker output means all linker messages are now visible.