← Back
SiTech Team⏱️ 7 წთ. საკითხავი

Bun Ditches Zig for Rust: Claude Fable 5 Wrote 1 Million+ Lines of Code in 11 Days

Bun Ditches Zig for Rust: Claude Fable 5 Wrote 1 Million+ Lines of Code in 11 Days

Jarred Sumner rewrote Bun's JavaScript runtime from Zig to Rust using 64 parallel instances of Claude Fable 5. Over 1 million lines of code were written in 11 days at an API cost of $165,000 — a job that would've taken a human team an entire year.

Introduction: A Historic Rewrite

The developer community is stunned. Jarred Sumner, creator of the Bun JavaScript runtime, has made a decision that fundamentally changes the trajectory of his project. Bun — originally built on Zig — has been completely rewritten in Rust. This is no ordinary refactoring: 64 parallel instances of Claude Fable 5 wrote over 1 million lines of code in just 11 days, a task that would have required an entire year for a human team.

This story represents one of the largest AI-assisted code migrations ever undertaken. It demonstrates how modern artificial intelligence can rewrite entire software projects in timeframes previously considered unimaginable.

Bun v1.4.0 is now available as a canary release. The new version fixes 128 bugs and runs 2-5% faster. But behind these numbers lies a much bigger story — how one developer made a call that could reshape an entire ecosystem.

Why Zig? And Why Leave It Behind?

Bun was originally built with Zig for good reason. Zig offers low-level memory control without the complexity of C, yet with a simpler syntax. It has no garbage collector and seemed like the ideal choice for building a high-performance JavaScript runtime.

However, as Sumner explained, working with Zig meant constantly battling memory errors and crashes that were nearly impossible to fix permanently. This wasn't just an occasional annoyance — Zig's memory management shortcomings were systematic, threatening Bun's stability at its core.

Rust, by contrast, offers an ownership model and borrow checker that catches the vast majority of memory bugs at compile time. This means many issues that would only surface at runtime in Zig are caught the moment the code is written in Rust.

The decision is especially significant given that Sumner's team was acquired by Anthropic in December 2025. Even with access to Anthropic's frontier AI models, he still chose to migrate to Rust — a clear signal that Zig's problems were deep and fundamental.

Claude Fable 5 — The 11-Day, 64-Instance Marathon

The most astonishing aspect of this project is its sheer scale. Sumner used a pre-release version of Anthropic's Claude Fable 5. Sixty-four Claude instances ran in parallel for 11 days straight, writing code, reviewing it, and systematically translating Bun's entire codebase from Zig to Rust.

The API bill came to roughly $165,000 — a serious sum, but consider the alternative: a human team's annual salary would start at $500,000 and likely exceed $1-2 million. The AI-driven rewrite saved not only 95% of the time but also proved significantly more cost-effective.

This kind of large-scale AI-assisted rewrite is a first of its kind. Previously, AI was used primarily for writing small code fragments, generating boilerplate, or fixing isolated bugs. Bun's rewrite demonstrates that AI can now handle structural migration of entire projects from one programming language to another.

Technical Challenges of the Migration

Migrating from Zig to Rust is technically demanding. While both languages are low-level and share similar memory management philosophies, fundamental differences exist:

  • Memory Model: Zig uses a more permissive approach to memory management, while Rust enforces ownership and borrowing rules. This dramatically increases safety but demands greater discipline during development.
  • Ecosystem: Rust boasts a vastly larger and more mature ecosystem, including Cargo (package manager), crates.io (registry), and an extensive tooling arsenal. Zig's ecosystem, while growing, remains comparatively small.
  • Concurrency: Rust's async/await model is more advanced, which is especially important for a JavaScript runtime that spends most of its time on I/O operations.
  • FFI (Foreign Function Interface): Bun requires tight integration with a JavaScript engine (primarily WebKit's JavaScriptCore) via FFI. Rust's FFI tooling, including bindgen, streamlines this process considerably.

Claude Fable 5 had to not only translate code literally from Zig to Rust but also ensure that Rust idiomatic practices were followed, making the resulting code not just functional but also maintainable and extensible.

Bun v1.4.0 — 128 Bugs Fixed, 2-5% Faster

The new Rust-based Bun v1.4.0 is already available as a canary release. Despite being a complete rewrite, the version numbering continues the existing sequence, indicating that the API-level changes are minimal — everything should work as before, only more stably.

The 128 fixed bugs testify to how serious Zig's memory-related problems were. Rust's compiler caught many of these issues during the build process, but 128 bugs still managed to make it to runtime — a sign that the underlying problems ran so deep that even Rust's safety guarantees couldn't catch everything automatically.

The 2-5% performance improvement isn't dramatic, but this is the first Rust version. As the team grows more comfortable with the Rust ecosystem and begins optimizing the code, 10-20% or greater performance gains are entirely realistic.

What This Means for Georgian Developers

Bun's rewrite carries several important lessons for Georgian developers and technology companies:

  • Rust's Importance Is Growing: When a project as significant as Bun migrates to Rust, it signals that Rust skills will become increasingly valuable in the job market. For Georgian developers, learning Rust may be a smart career investment.
  • AI Can Handle Large-Scale Migration: Claude Fable 5 rewriting 1 million lines in 11 days proves AI can migrate entire codebases between languages. This is especially relevant for Georgian businesses running legacy systems.
  • Language Choice Remains Critical: Sumner's decision shows that language choice in long-term projects is decisive. Despite Zig's theoretical advantages, practical experience revealed its limitations.
  • Cloud AI Is Cheaper Than Human Labor: The $165,000 API bill may seem steep, but it's a fraction of what a human team would cost.

Impact on the JavaScript Ecosystem

Bun is one of the most popular modern JavaScript runtimes, increasingly used as a Node.js replacement. It offers a built-in package manager (bun install), bundler, test runner, and TypeScript support — all in a single binary.

The move to Rust could accelerate Bun's development significantly. Rust's larger contributor community means more potential contributions, while Cargo and crates.io solve many problems that previously required building custom solutions in Zig.

This development is also significant in the context of Deno and Node.js. Bun is already positioned as the fastest JavaScript runtime, and the Rust migration may widen that gap. Interestingly, Deno was built on Rust and Tokio from the start, meaning the "arms race" between Bun and Deno could intensify considerably.

Conclusion — A New Era of AI-Human Collaboration

Bun's rewrite from Zig to Rust using Claude Fable 5 is a historic moment in software engineering. This is more than a technical migration — it's a demonstration of how AI can reshape an entire industry.

Sixty-four Claude instances spending 11 days and $165,000 to rewrite over 1 million lines of code has proven that AI can handle tasks previously considered the exclusive domain of human engineering teams. This doesn't mean developers are no longer needed — on the contrary, guiding, managing, and controlling AI remains a human responsibility. But tasks like translating code between languages are now firmly within AI's capabilities.

For Georgian developers and technology businesses, the Bun story is both a warning and an opportunity. A warning that the technological choices we make today have long-term consequences for our products. An opportunity that AI tools are now ready for large-scale tasks, creating a new level of competitiveness in the Georgian market.

The message is clear: the era of AI-assisted software engineering at scale has arrived. Bun and Claude Fable 5 have lit the fuse — the question is not whether this approach will become mainstream, but how quickly.