Anthropic 的 Bun 完成 Rust 重写并合并入主仓库
Anthropic’s Bun Rust rewrite merged at speed of AI
Anthropic 旗下 JavaScript 运行时 Bun 的 Rust 重写版本已合并入主仓库,新增超过一百万行代码,作者 Jared Sumner 称其在所有平台通过测试套件、修复部分内存泄漏并将二进制体积缩小 3 至 8 MB。Sumner 表示性能持平或更快,架构与数据结构不变,且团队已数月不自己写代码,主要依靠 Claude Code 维护。此前移除约 60 万行 Zig 代码的第二个 PR 被 GitHub 标记为 AI slop 并关闭。
推荐理由
精选AI 评分 76
Bun 用 AI 工具在数天内完成 Zig 到 Rust 的百万行代码迁移,读者可据此观察 AI 辅助大规模重构的边界与争议。
主题
正文
当前显示原文,中文全文译文尚未就绪。
AI/ML
A pull request with a Rust version of Anthropic’s Bun, a JavaScript toolkit and runtime originally written in Zig, has been merged to the main Bun repository. This comes just days after its author, Jared Sumner, said "there's a very high chance all this code gets thrown out."
Sumner posted on X (formerly Twitter) five days ago that "99.8 percent of bun's pre-existing test suite passes on Linux x64f glibc in the rust rewrite," a clue that what was initially described as an experiment was likely to make it to production. Three days later, the Bun team released version 1.3.14, with Sumner stating that if the Rust rewrite was merged, "this would be the last version in Zig."
Today that merge took place, adding more than one million lines of code. Sumner said it passes Bun's test suite on all platforms, fixes some memory leaks, and shrinks the binary size by between 3 and 8 MB.
"Most importantly, we now have compiler-assisted tools for catching and preventing memory bugs, which have cost the team an enormous amount of development and debugging time over the years," he said in a comment. Performance is either neutral or faster, he said, though the codebase is "the same architecture, the same data structures." No async Rust is used.
Bun users have hit memory leak issues when deploying it as a production runtime. According to Sumner, "Rust won’t catch all of these - leaks from holding references too long and anything that re-enters across the JS boundary are still on us. But a large percentage of that list is use-after-free, double-free, and forgot-to-free-on-error-path, and those become compile errors or automatic cleanup."
A second pull request, removing upwards of 600,000 lines of Zig code, was automatically flagged by GitHub as "AI slop" and closed, but will presumably reappear in some form.
The size of these commits makes them near-impossible for humans to review. "What a nice reviewable little commit. I'm sure it will not contain any bugs," said one comment on the Rust merge.
Although the idea of the Rust port has been well received, the speed of the transition has taken the community by surprise. In normal circumstances, porting a major project so quickly would be risky, but this has been accomplished using AI tools. According to Sumner, it is "essentially the same codebase ported to Rust."
Asked whether the Rust version would be maintained mainly by Anthropic’s Claude Code, Sumner said "this is already the status quo; we haven’t been typing code ourselves for many months now. Even pre-acquisition [by Anthropic] this was pretty much accurate."
Sumner was formerly a strong Zig advocate, but Zig’s no-AI policy is at odds with the Bun team’s way of working, and recent versions of Bun use a Zig fork with contributions that cannot be merged upstream, and which Zig’s maintainers said would not be welcome regardless of the AI aspect.
Version 1.3.14, the last one still to use Zig, adds a built-in image processing API for decoding, transforming and encoding images. It is designed as a drop-in replacement for the Sharp image processing library for Node.js. The new release also adds experimental support for the HTTP/3 (QUIC) protocol in Bun’s integrated server. The full release notes describe these and other new features.
Is it possible to move this fast and not break things? Bun's migration from Zig to Rust will be watched with interest by AI advocates and sceptics alike.
When you just need to build a tiny desktop app: TinyJS
October 13, 2026
Valen creator drives 'Golden Spike' to connect new languages with Rust
September 26, 2026
Microsoft agentically ports Copilot runtime to Rust for $120K
September 19, 2026
Apple iPhone Duo makes developers think in folds
September 16, 2026
JavaScript installer pnpm recast in Rust because ECMAScript can't keep up
September 5, 2026
Kubernetes cleans house, bins legacy kube-dns, IPVS, and cgroup v1
August 27, 2026
How Cursor beat Git's scalability shortcomings
August 24, 2026
Go updates may delight diehard gophers but displease AI overlords
August 21, 2026
SvelteKit 3 puts heat on Next.js with radical approach to RPCs
August 20, 2026
Almost nobody pays attention to web standards anymore
August 18, 2026
ChainDrop worm crawls into npm supply chain, evades standard defenses
August 16, 2026
Node.js creator liberates Durable Objects from Cloudflare
August 13, 2026
AI titans to tidy agent frontier with plugin prescription
August 8, 2026
Platform Engineering 2.0: your platform was built for a different era. AI just exposed it
August 6, 2026
Next.js 16.3 aims to reduce dreaded FATAL ERROR messages
August 5, 2026
Dev who gave HashiCorp its name returns with a faster terminal multiplexer
August 1, 2026
How AI drove Shopify back to clean code
Turns out, agents just want the same things as humans: easily-readable code, explicit contracts, and helpful feedback
July 26, 2026
Zig creator calls Bun's Claude Rust rewrite 'unreviewed slop'
July 15, 2026
HTTP gets a QUERY method so complex searches can stop pretending to be POST
July 14, 2026
Speedier type checks in TypeScript 7.0 as first stable Go release ships
July 10, 2026
GitHub cuts short offer to burn repos on CD after mockery ensues
A purported jab of Sony's physical media phase-out blows up on GitHub itself
July 7, 2026
.NET's long term support is not long term enough, dev complains
June 30, 2026