Bun's experimental Rust rewrite hits 99.8% test compatibility on Linux x64 glibc
Overview of the Bun Rust Rewrite
- Bun’s Zig codebase (~950k–1M LOC) has been largely ported to Rust in ~6 days using LLM-based agents.
- New Rust version reportedly passes ~99.8% of Bun’s existing Linux x64 glibc test suite.
- The work is framed as both an experiment and potentially a real migration; earlier comments called it “just an experiment,” later ones sound more committed.
Role of LLMs, Tests, and Engineering Effort
- Many note this is a “sweet spot” for LLMs: mechanical translation plus a strong, comprehensive test suite as an oracle.
- Several commenters stress that the impressive 6‑day port rests on “hundreds of thousands of hours” that went into the original design and tests.
- Others argue this still represents a massive speedup over a human-only rewrite and showcases where agents shine.
Cost, Tokens, and Economics
- Rough back-of-envelope estimates for compute range widely: from ~$10–20k up to ~$0.5M, with debate over reasonable assumptions.
- Some emphasize that even a six-figure API bill can be cheaper and vastly faster than a large team of engineers; others point out most companies would not casually burn that money without strong justification.
- There’s concern about a “token-rich class” with access to many parallel agents and better models versus ordinary developers.
Reliability, Safety, and Code Quality
- Bun has historically had many segfault/memory issues; Rust’s safety model is seen as a key motivation to reduce undefined behavior.
- Skeptics highlight:
- Passing tests ≠ real-world correctness or performance parity.
- Prior examples (e.g., the LLM C compiler, Rust coreutils) where 100% test pass still hid serious issues.
- Risk that huge, rapidly generated codebases are poorly understood and hard to maintain.
Impact on Zig and Language Ecosystem
- Some see this as a blow to Zig’s reputation, since Bun was a flagship Zig project; others argue Zig remains strong in its niche (low‑level, embedded, “better C”) with other showcase projects.
- Debate over whether Zig’s lack of borrow-checker-like guarantees makes high-reliability at Bun’s scale harder, versus claims that disciplined Zig/C++ can still produce robust systems.
Broader Implications for Software & Jobs
- Excitement: LLMs make large rewrites and legacy ports (COBOL, ngspice, Postgres, TypeScript compilers) feasible.
- Anxiety: job displacement, concentration of power in a few AI vendors, and the prospect of codebases largely generated and modified by machines with fewer humans understanding them.