When Bun Switched to Rust, the Zig Community Revived Its Legacy Code as Buz
After Bun migrated to Rust with AI assistance, the Zig community forked its abandoned Zig codebase to create Buz, rebuilt it with a modern Zig toolchain, achieved sub‑second incremental builds, and now enforces AI‑assisted contributions while remaining an experimental, platform‑limited project.
21CTO notes that after Bun fully embraced Rust with AI, the Zig community took over Bun's abandoned Zig code and launched a new project called Buz. By migrating to a modern Zig toolchain and build system, Buz compresses incremental compilation to under one second and only accepts AI‑assisted code to quickly clear technical debt.
Bun's Zig era officially ended when Jarred Sumner orchestrated a massive migration to Rust, running 64 Claude instances continuously for 11 days. The rewrite branch merged into the main line on May 14 and a full post‑mortem was released in July, resulting in 6,522 commits and over one million new lines of code. However, the latest stable Bun release remains v1.3.14—the last Zig‑based version—while the Rust rewrite lives on the main and canary branches, with v1.4 still unreleased.
Buz fills this gap by inheriting the final Zig commit before Bun's Rust transition and aims to be a seamless runtime replacement for Bun. Unlike the earlier Cruller project, which stripped away the package manager, bundler, and test tools, Buz plans to retain Bun's full ecosystem for a 1:1 swap.
Core breakthrough: build time under one second
For original Bun developers, slow compilation was a major pain point, with engineers reporting 181 minutes wasted each week waiting for Zig builds. Buz's author migrated the entire build graph to build.zig, unified low‑level C/C++ dependencies such as JavaScriptCore and ICU, tracked Zig's latest main branch, and applied incremental build patches.
Running the incremental debug command: ./zig build --watch -fincremental now completes in under one second. About 60% of the remaining time is spent in the mold linking stage; further improvements in Zig's native linker could push build times to 300 ms, dramatically improving developer experience for large low‑level projects.
Additional refactors
Dead code cleanup : removed more than 11,000 lines of unused code.
Test suite sync : integrated new Rust‑based Bun test cases to keep feature parity and bug fixes.
Standard library adoption : progressively replaced custom utilities with the Zig standard library.
Upstream synchronization : continuously updated file‑system, hashing, and CLI modules.
Within a week of launch, Buz garnered roughly 190 GitHub stars. Code statistics show about 60% Zig and 26% C++—highlighting that, regardless of the outer language, core components like JavaScriptCore remain crucial.
AI‑only contribution policy
The repository explicitly requires that all code submissions be assisted by an LLM, lifting the restriction only after test coverage and code health meet defined thresholds. The rationale is that manually sifting through nearly 600 k lines of legacy code would exhaust maintainers, so AI handles bulk cleanup while human developers steer architecture and audit correctness. All contributions must also pass deep reviews by Sol Max or Fable Max.
When Bun’s founder Jarred responded on X, he noted that Bun itself had recently removed about 39 k lines of dead code and that Claude continuously scans for such code. He emphasized Bun’s need to support multiple platforms (Linux, Windows, macOS, FreeBSD, Android) and architectures (x64, ARM64), with many platform‑specific sections only active under certain compile targets.
Current assessment: experimental stage
Despite ambitious goals, Buz remains far from a production‑ready seamless replacement. The README lists several risks:
Platform limitation : currently focuses on x86_64-linux-gnu local builds and tests.
Test failures : many upstream Bun test cases still fail.
Security concerns : the bundled JavaScriptCore version lags behind, missing recent security patches and containing known vulnerabilities.
No stable release : the project is still an experimental playground without an official stable version.
The biggest future challenge is keeping pace with Bun’s evolution—whenever Bun adds new Node.js APIs, fixes cross‑platform bugs, or upgrades JavaScriptCore, Buz must invest effort to sync. For a community‑driven project, this long‑term tug‑of‑war is likely more demanding than the initial build‑time improvements.
Nevertheless, the experiment holds high value: Bun’s shift to Rust demonstrated the feasibility of AI‑driven, large‑scale language migration, while Buz explores whether modern Zig, a rebuilt toolchain, and AI‑assisted debt reduction can yield a more maintainable low‑level system without changing the language.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
