Anthropic's LLM Converts Bun to Rust with 10k Unsafe Blocks
TL;DR. Anthropic's Claude Code agents completely rewrote the Bun JavaScript runtime from Zig to Rust in nine days. - The LLM-generated Rust code passed 99.8% of existing tests, showing functional equivalence to the original. - The rewrite introduced over 10,000 unsafe blocks, raising questions about actual memory safety gains. - Bun's acquisition by Anthropic and its use of LLMs for core development highlights a new AI trend for code.
- Anthropic acquired Bun in December and used its Claude Code LLMs to rewrite the Bun runtime.
- The rewrite involved over one million lines of Rust code and 6,755 commits.
- Despite the security-focused motivation for using Rust, the LLM-generated code contains 10,000+ 'unsafe' blocks.
- The rewrite maintains performance parity and reduces binary size, but the safety claim is compromised by the unsafe blocks.
Sources
- Bun Has Been Converted to Rust. Now What? — bytecode.news