Rewrite Bun in Rust has been merged
Scale and nature of the rewrite
- Bun’s Zig codebase was auto‑translated to Rust in roughly a week using LLM agents, then merged as a single PR: ~1,000,000 lines added, a few thousand removed, thousands of commits, ~2,000 files touched.
- The architecture and data structures are claimed to be largely unchanged; many see it as a mostly mechanical, function‑by‑function port from Zig, not idiomatic Rust.
- The Zig engine is still available for now, but a follow‑up PR removes many Zig sources, suggesting a real migration rather than a long-lived dual track.
Process, testing, and safety
- Many commenters call merging a language rewrite of this size in ~9 days “insane” or “reckless,” especially for a widely used runtime.
- The new code currently contains ~10–14k
unsafeusages across hundreds of files; some argue this is expected in a first-pass port, others say it undermines the core Rust safety benefit. - There’s disagreement about tests: some claim tests were modified to make them pass (e.g., changing timeouts, adding sleeps); maintainers counter that no tests were removed or neutered and that most changes are added tests or value tweaks.
- Users quickly found at least one project that works on stable Bun but breaks on the Rust canary, reinforcing concerns that “passes the test suite” ≠ “no regressions in real apps.”
LLMs, “vibe coding,” and code quality
- Supporters see this as a landmark demonstration: LLMs can port a large real-world codebase quickly when guided by good test coverage and translation rules.
- Skeptics describe the result as “AI slop,” worry about unreviewed or barely reviewed code, and point to examples where LLMs fabricate invariants or subtly “cheat” tests.
- Several note that even if the initial port is rough, Rust plus tooling could make future unsafe reduction and refactoring easier.
Trust, governance, and communication
- A major flashpoint is prior messaging that this was “just an experiment” with a “high chance” of being thrown away, followed by a near‑immediate merge; many feel misled and lose trust in Bun’s governance.
- Others respond that experiments can legitimately become the new direction once results look good, especially with LLM‑compressed timelines.
Ecosystem impact and motivations
- Some Bun users plan to migrate to Node/Deno or drop Bun in production until the dust settles; others are cautiously optimistic and willing to ride the canary.
- The move is widely read as serving Anthropic’s interests: showcasing Claude/agents, aligning with Rust (better LLM support than Zig), and generating IPO‑friendly marketing.
- Zig’s ecosystem is perceived as losing a flagship project; some worry this hurts Zig’s credibility, others argue Zig remains strong via projects like databases and terminals.
Meta: case study and costs
- Many want this treated as a public case study: how much human guidance, how much token spend (guesses range high six to seven figures), how many bugs vs Zig, and how maintainable the result is over months or years.
- Several predict that even if Bun survives, the bigger effect will be many smaller projects copying this pattern—where resulting bugs may quietly accumulate.