Rewriting Bun from Zig to Rust Using Claude Agents
Simon Willison · rss · 2026-07-09
The creator of Bun detailed how they leveraged cutting-edge AI coding agents to rewrite the massive Bun runtime from Zig to Rust in just 11 days. - **Rewrite Motivation**: Zig's mixed garbage collection (GC) and manual memory management led to numerous hard-to-track memory errors (like use-after-free). In safe Rust, these issues become compile-time errors or are automatically cleaned up. - **Agent Engineering Practices**: The project relied heavily on language-independent test suites as a consistency check. Through advanced agent orchestration techniques like dynamic workflows, dry runs, and adversarial reviews, the bulk of the initial porting was automated. - **Results and Costs**: The new Rust implementation has been quietly running in Claude Code for nearly a month, boosting Linux startup speeds by 10% with almost no one noticing (stability first). This rewrite consumed roughly 5.9 billion uncached input tokens, with API costs estimated at $165,000.
More from coding & agent
- Autoresearch proposes packaging ML runs as studies with questions, analysis, and code diffs — morgymcg · 2026-07-21
- CHAP defines approvals, handoffs, and audit logs for human-agent workflows — DeliveryTechnical199 · 2026-07-21
- The author says Codex reached 20x and is now debugging spec decoding on a hybrid parallel setup — TheZachMueller · 2026-07-21
- Axcess adds an MCP connector for WCAG accessibility checks that scanners miss — modelcontextprotocol · 2026-07-21
- X post asks whether Cursor Composer, built on Kimi models, would also be banned — max_paperclips · 2026-07-21
- A developer’s Codex usage is draining pooled enterprise credits at a small company — Distinct_Relation_62 · 2026-07-21