In Just 11 Days, Claude Rewrote Millions of Lines of Code, an Epic AI Engineering Feat Sparks Fury

marsbit发布于2026-07-11更新于2026-07-11

文章摘要

In just 11 days, Bun's founder Jarred Sumner used Anthropic's Claude AI models to rewrite its million lines of code from Zig to Rust. This move sparked significant controversy, particularly from Zig's creator, Andrew Kelley, who publicly criticized Sumner's engineering practices and the decision to use AI for such a massive rewrite. Bun, a high-performance JavaScript/TypeScript runtime and rival to Node.js, was originally written in Zig. After Anthropic acquired Bun, the team encountered persistent stability and memory safety bugs in the Zig codebase. These issues, combined with Zig's strict policy against LLM-generated code, led to the decision to rewrite in Rust. The rewrite was executed using Claude AI tools at an estimated API cost of $165,000, dramatically reducing the expected time and financial cost. Andrew Kelley's response was scathing. He blamed the original bugs on poor engineering habits, calling Bun's Zig code a collection of "hacks on top of hacks." He expressed relief that Bun was no longer associated with Zig, fearing it would misrepresent the language and attract low-quality, AI-generated contributions. The tech community is divided; some view Kelley's critique as unprofessional, while others see it as a defense of engineering integrity. A major concern about the AI-driven rewrite is the resulting code quality. The translation from Zig left approximately 27,000 lines of unsafe Rust code, raising fears about long-term maintainability and technical debt. The...

These days, the tech community has been feasting on drama: Zig programming language creator Andrew Kelley is furious.

The reason? Bun, which had fully committed to the Zig language, was rewritten in Rust by its founder, Jarred Sumner.

Andrew Kelley didn't mince words, showing his anger without the usual polite discourse surrounding such a phenomenal tech event. He directly targeted Jarred Sumner's personal engineering habits, management abilities, and the business logic behind this move.

Bun is a high-performance JavaScript/TypeScript runtime, designed to be a faster, modern direct replacement for Node.js. In recent years, it has become a heavyweight contender challenging Node.js's dominance in the frontend world.

Bun's core selling point is speed: whether it's startup time, dependency installation, or test execution, it far outpaces its competitors, partly because it was originally written in Zig.

In December last year, Anthropic announced its acquisition of Bun, planning to use it as infrastructure to power its AI coding tools, Claude Code and the Claude Agent SDK. Jarred Sumner and other Bun team members are now working at Anthropic.

After large-scale application, especially as the underlying layer for Claude Code, the Bun team encountered what they deemed to be intractable stability issues.

Specifically, the Zig version of Bun had a significant number of memory safety bugs — use-after-free, double-free, forgetting to free memory on error paths, etc. In Zig, these issues rely on coding conventions for prevention, whereas in Rust, the borrow checker and Drop mechanism turn them directly into compilation errors.

On another front, the upstream Zig community maintains a zero-tolerance policy towards code generated by large language models (LLMs). Even optimization patches unrelated to AI could not be merged upstream. The Bun team heavily relies on AI-assisted development, and continuing with Zig meant having to maintain their own compiler fork long-term, at a high cost.

Thus, in May of this year, we witnessed a major engineering feat in the tech world: Bun's founder Jarred Sumner announced that they had rewritten Bun's million lines of code in Rust within 11 days. They used Anthropic's then-unreleased Claude Fable 5 (a Mythos-level model) and the dynamic workflow capabilities of Claude Code.

This was an epic large-scale test of Agentic Workflows, later promoted by Anthropic as a benchmark case for Dynamic Workflows, but it also sparked controversy for "betraying the faith."

In a recent blog post, Zig creator Andrew Kelley argued that the root cause of Bun's bugs before the rewrite was Jarred Sumner's poor engineering habits.

First, even before AI became prominent, Jarred was consistently writing poor-quality code. Kelley stated that the Zig team often reviews users' codebases, and Bun's codebase filled them with "extreme fear." It was full of hacky patches stacked on top of more hacks, abused assertions, and in the rush to push new features quickly, they almost never took time to fix bugs or address technical debt.

Then came the million lines of code generated by Claude. Kelley countered: "Bun officially claims that 1 million lines of unvetted Rust (AI-written) code are safe because there are test cases; well, if the test cases were really that comprehensive, why didn't they catch all those pesky bugs in the original Zig-written version?"

Now, Kelley expresses deep disappointment with Jarred's transformation from an open-source developer with "beginner energy" into a "stinky manager."

Kelley bluntly stated that when he learned Bun was abandoning Zig, he wasn't angry about the betrayal but rather relieved. He was afraid that Bun, bearing the Zig name, would create misunderstandings externally and, worse, attract users who only copy-paste AI-generated code. He even sarcastically remarked that he's now enjoying a cup of tea, glad that "this is finally not my problem anymore."

With such direct confrontation, others in the tech community have joined the fray, sharing their views.

First, some did the math: Claude's tokens are often criticized as expensive, but based on data released by Jarred Sumner and Bun, the Rust rewrite of the Bun project is estimated to have consumed $165,000 in API fees. In the tech and engineering world, this price and timeline are frighteningly cheap.

On paper alone, AI compressed development costs to about one-tenth of the original estimate, and the time was reduced from roughly a year to less than two weeks.

Secondly, there's the debate on the collision of open-source community culture with the AI era. After reading Andrew Kelley's blog post, some felt extremely uncomfortable, believing his public attack on a former major user and sponsor (Bun had long funded Zig) showed a lack of professionalism. Some even radically expressed they had "never before so actively wished for a programming language to fail."

However, veteran programmers also voiced support, arguing that in this era driven by capital and AI hype, Andrew is merely defending pure engineering quality, reminiscent of Linus Torvalds's style back in the day.

Of course, everyone is more concerned about whether the project is still usable after such a drastic overhaul.

The biggest point of contention currently is that, since the 1 million lines of code were mechanically translated from Zig by AI, they lack the architectural refactoring a human engineer would provide. The new codebase retains a staggering 27,000 lines of `unsafe` code blocks. Many worry that the cognitive and debugging costs for human developers maintaining, reading, and modifying this massive "AI-generated blob" in the future might ultimately exceed the upfront development costs saved today.

Will this project, which breaks the established rules of software engineering history, become a milestone where AI reshapes programming paradigms, or will it eventually erupt as an unmaintainable volcano of technical debt? Only time will tell.

References:

https://bun.com/blog/bun-in-rust

https://andrewkelley.me/post/my-thoughts-bun-rust-rewrite.html

This article is from the WeChat public account "Machine Heart" (ID: almosthuman2014), author: Focus on AI.

热门币种推荐

相关问答

QWhat is the main reason Bun's founder, Jarred Sumner, decided to rewrite the entire Bun project from Zig to Rust?

AThe main reason was to address persistent stability issues, particularly memory safety bugs (like use-after-free, double-free) that were difficult to eradicate in Zig. Rust's ownership and borrowing model turns these issues into compile-time errors, offering stronger safety guarantees. Additionally, Zig's upstream community had a zero-tolerance policy for LLM-generated code, which conflicted with Bun team's heavy reliance on AI-assisted development, forcing them to maintain their own compiler fork.

QWhat was Zig creator Andrew Kelley's primary criticism regarding the quality of Bun's original Zig codebase?

AAndrew Kelley criticized that the Bun codebase, even before AI was heavily used, was poorly engineered. He described it as being filled with 'hacks on top of hacks,' rampant use of assertions, and a general lack of effort to fix bugs or address technical debt in favor of quickly shipping new features. He attributed the bugs to Jarred Sumner's 'stinky manager' habits and poor engineering practices rather than a flaw in the Zig language itself.

QAccording to the article, how much did the AI-assisted Rust rewrite of Bun cost in API fees, and how long did it take?

AAccording to data released by Jarred Sumner and Bun, the Rust language rewrite of the Bun project was estimated to have consumed approximately $165,000 in API fees. The entire process of rewriting the million lines of code was completed in just 11 days.

QWhat is a major technical concern raised by developers about the new AI-generated Rust code for Bun?

AA major concern is that the AI mechanically translated the code from Zig to Rust without significant architectural refactoring by human engineers. As a result, the new codebase contains a high number of 'unsafe' code blocks—reportedly 27,000 lines. Critics worry that the cognitive load and debugging costs for future human developers maintaining this 'AI-generated artifact' could eventually outweigh the initial development time and cost savings.

QWhat conflicting viewpoints does the article present about the community reaction to Andrew Kelley's public criticism?

AThe article presents two conflicting viewpoints. One side criticizes Andrew Kelley, finding his public attack on a former major user and sponsor (Bun had funded Zig) unprofessional and lacking in grace. Some even expressed a desire for Zig to fail. The other side, including veteran programmers, defends him, viewing his stance as a defense of pure engineering quality and craftsmanship in an era dominated by capital and AI hype, comparing his directness to that of figures like Linus Torvalds.

你可能也喜欢

交易

现货

热门文章

如何购买EPIC

欢迎来到HTX.com!我们已经让购买Epic Chain(EPIC)变得简单而便捷。跟随我们的逐步指南,放心开始您的加密货币之旅。第一步:创建您的HTX账户使用您的电子邮件、手机号码注册一个免费账户在HTX上。体验无忧的注册过程并解锁所有平台功能。立即注册第二步:前往买币页面,选择您的支付方式信用卡/借记卡购买:使用您的Visa或Mastercard即时购买Epic Chain(EPIC)。余额购买:使用您HTX账户余额中的资金进行无缝交易。第三方购买:探索诸如Google Pay或Apple Pay等流行支付方法以增加便利性。C2C购买:在HTX平台上直接与其他用户交易。HTX场外交易台(OTC)购买:为大量交易者提供个性化服务和竞争性汇率。第三步:存储您的Epic Chain(EPIC)购买完您的Epic Chain(EPIC)后,将其存储在您的HTX账户钱包中。您也可以通过区块链转账将其发送到其他地方或者用于交易其他加密货币。第四步:交易Epic Chain(EPIC)在HTX的现货市场轻松交易Epic Chain(EPIC)。访问您的账户,选择您的交易对,执行您的交易,并实时监控。HTX为初学者和经验丰富的交易者提供了友好的用户体验。

724人学过发布于 2025.03.17更新于 2026.07.21

如何购买EPIC

相关讨论

欢迎来到HTX社区。在这里,您可以了解最新的平台发展动态并获得专业的市场意见。以下是用户对EPIC(EPIC)币价的意见。

活动图片