Bun's AI-Generated Rewrite from Zig to Rust: 1 Million Lines, 10,000+ Unsafe Blocks
By
By dreamreal|June 3, 2026|Updated 12:14pm ET
Fresh out the oven, still warm. Top of the tray.
Summary
Bun, the JavaScript runtime, has been rewritten from Zig to Rust through an AI-driven process. Anthropic (which acquired Bun in December) supplied Claude Code agents that generated over a million lines of Rust code across 6,755 commits in nine days. The rewrite passed 99.8% of existing tests but introduced more than 10,000 unsafe blocks, raising questions about whether the memory safety goals of Rust were actually achieved. The article explores the implications of AI-generated codebases, the irony of unsafe Rust blocks in a memory-safe language, and what this means for the future of software development.
Key quotes
· 5 pulledwe haven't been typing code ourselves for many months now
a little over a million lines of Rust, 6,755 commits, generated almost entirely by Claude Code agents over nine days
The Rust rewrite passed 99.8% of the existing tests
Memory safety is the main reason you'd pick Rust. So what did the rewrite actually accomplish?
the PR itself split almost evenly between thumbs-up and thumbs-down
You might also wanna read
Bun: A New JavaScript Runtime with Built-in Development Tools
Bun is a new JavaScript runtime that serves as an alternative to Node.js, featuring built-in tools including a native bundler, transpiler, t
The Verification Crisis: How AI-Generated Code Is Reshaping Software Development
The article examines the rapid integration of AI in software development, highlighting staggering statistics: Cursor alone generates nearly
dev.to·4d ago