Skip to main content
AI Socratic
Bun rewrite in Rust

Bun-in-Rust rewrite would cost ~$165k in API tokens — QT of the Bun blog: what the rewrite would have cost if done over API.

  • The Move: Bun (acquired by Anthropic) successfully rewrote its entire 535,000-line Zig codebase into Rust.
  • The Reason: Mixing Zig's manual memory management with JavaScriptCore's garbage collector caused persistent, hard-to-debug crashes (like use-after-free). Rust's compiler and borrow checker permanently eliminate this class of bugs.
  • The Process: Instead of a slow, year-long transition, they completed an "all-at-once" mechanical translation in just 11 days using a pre-release version of Claude Fable 5.
  • The Pipeline: They ran 64 parallel Claude loops across 4 worktrees, generating up to 695 commits per hour.
  • Quality Control: To prevent hallucinations, they used an adversarial workflow: 1 Claude "implementer" wrote the code, 2 isolated Claude "reviewers" tried to break it, and a final Claude "fixer" resolved the issues. This pipeline successfully resolved over 16,000 compiler errors across 6,502 total commits.

Sources: @jarredsumner (Jarred Sumner), blog post, AI Socratic - July 2026

About the Authors

Federico Ulfo

Federico Ulfo

Founder, Engineer

New York City