Anthropic's Bun JavaScript runtime merged a 1,009,257-line Rust rewrite on May 14, completing a port that PR #30412 describes as essentially the same codebase ported to Rust. Bun creator Jarred Sumner shipped the change after nine days of agent-driven coding, and the new tree passes 99.8 percent of the existing Zig test suite on Linux x64.
What Happened
The merge replaces Bun's Zig core with 681,000 lines of compiled Rust across 6,755 commits. According to The Register, the rewrite was driven by Claude Code in a four-phase loop: ingest the Zig source, emit Rust in parallel, feed compiler errors back, and check against Bun's existing test suite. Sumner started with more than 16,000 compiler errors and ended nine days later with a 99.8 percent pass rate. A companion cleanup PR that removed roughly 600,000 lines of Zig was titled "ai slop" by Sumner himself, and GitHub's automated anti-AI-slop detection promptly flagged it.
How to Try It
The Rust runtime ships as the next stable. To install on macOS or Linux:
curl -fsSL https://bun.sh/install | bash
Then run a Node-compatible script with bun run index.ts. Binary size is 3 to 8 MB smaller than the Zig builds, and memory should be tighter as Rust's ownership model catches what manual Zig allocation missed. For production projects, pin to Bun 1.3.14 (the last Zig release on the official releases page) while the Rust tree settles, then move to the new build once the post-merge issue tracker clears.
Why It Matters
This is the largest production rewrite to date credited to AI coding agents. Anthropic acquired Bun in December 2025 to put a flagship JavaScript runtime behind Claude Code, and the migration validates a workflow that any team running a large Zig, Go, or C++ codebase will now feel pressure to evaluate: feed the source to an agent, iterate on compiler output, ship.
The catch is what came with the speed. byteiota counted 13,000-plus unsafe blocks in the new tree, roughly 181 times the density of the uv Python tooling project at comparable size. Some of that is unavoidable JavaScriptCore FFI work; some of it is what happens when an agent ports code without redesigning around Rust's ownership rules. Expect the first weeks of breakage to land there.
Key Details
- PR #30412 merged May 14, authored by Jarred Sumner
- 1,009,257 lines added, 4,000 deleted, 2,188 files changed
- 6,755 commits generated over 9 days by Claude Code
- 99.8 percent test pass rate on Linux x64 with glibc
- 13,000-plus
unsafeblocks, mostly at JSC FFI boundaries - Last Zig build tagged as Bun 1.3.14
What to Do Next
If you ship a Node-compatible project, install the Rust build into a branch and run your test suite before bumping production. If you maintain a large Zig, Go, or TypeScript codebase, the Bun PR is now the reference workflow for an agent-driven port. The 13,000 unsafe blocks are where the first bugs will surface, so treat the new tree as a release candidate rather than a stable LTS until the upstream issue volume tapers.