US National Wire
TechOpinion

Opinion: The $165k Rewrite: How AI Just Commoditized High-Performance Engineering

Portrait of Malik Reyes
Malik Reyescreator economy & platformsJul 14AI
Opinion: The $165k Rewrite: How AI Just Commoditized High-Performance Engineering

AI-generated image · US National Wire

Bun's migration from Zig to Rust proves that 'impossible' architectural overhauls are no longer human-scale problems—they are API costs.

For decades, the cardinal rule of software engineering was simple: never rewrite a large piece of software from the ground up. As Joel Spolsky famously noted in 2000, such undertakings were considered catastrophic risks. But the recent migration of Bun—the JavaScript runtime, bundler, and package manager—suggests that the cost of high-performance engineering has just collapsed.

Jarred Sumner, the creator of Bun, recently announced he ported the entire project from the Zig programming language to Rust in just 11 days. The scale of the effort was gargantuan: over a million lines of Rust code were generated. In a traditional engineering environment, Sumner noted that a small team of humans would have required a full year to complete the task, necessitating a total freeze on bugfixes, security fixes, and feature development.

Instead, Sumner utilized a fleet of approximately 50 dynamic Claude Code workflows. At its peak, the system generated 1,300 lines of code per minute. The total cost for this architectural pivot? Roughly $165,000 at API pricing — a bill reflecting 5.9 billion uncached input tokens, 690 million output tokens, and 72 billion cached input token reads.

From a monetization and platform perspective, the real story isn't the speed—it's the shift in the unit economics of development. High-performance rewrites, once the domain of elite, expensive engineering teams working over many months, are becoming commodity services you can buy via API. As HashiCorp co-founder Mitchell Hashimoto observed on X, no human engineer at a comparable salary could have hit these milestones in 11 days.

However, this collapse in cost comes with a massive debate over quality. Andrew Kelley, the creator of Zig, has labeled the result 'unreviewed slop.' Kelley argues that the move to Rust wasn't about language features, but a reflection of 'diverging value systems.' He claims Bun's codebase was already riddled with technical debt and bad programming practices before the AI intervention.

Sumner’s justification for the rewrite was rooted in stability. He noted that Bun's architecture mixed garbage collection with application-driven memory management—a task Zig wasn't designed for—leading to use-after-free and double-free bugs. One such bug in the bundler was implicated in a 512,000-line source leak from Anthropic (which acquired Bun in December 2025) in March. Rust's ability to automate memory management offered a systemic fix that human engineers couldn't feasibly implement quickly.

To validate the AI's work, Sumner relied on a language-independent test suite written in TypeScript, which served as a conformance suite with over one million assertions. According to Sumner, the Rust port passed 100 percent of these tests. While the end-user impact was minimal—startup speed improved by 10% on Linux—the structural implication is profound. When a million-line rewrite costs less than a mid-level engineer's annual salary and takes less than two weeks, the 'impossible' rewrite becomes a standard business operation.

Sources

More from Malik Reyes