Bun 1.4: AI Rewrote the Runtime in Rust in Six Days Bun 1.4, released August 20, rewrote its runtime core from Zig to Rust in six days using Anthropic's Claude Code, translating 570,000 lines of Zig into 682,000 lines of Rust, and boosting Node.js compatibility by 1,517 passing tests. The AI-generated code contains 13,044 unsafe blocks and 999+ instances of static mut, raising safety concerns, but the team shipped it and later released 1.4.1 with HTTP/2 and 202 bug fixes. Bun 1.4 landed August 20 and the headline feature isn’t a new API — it’s a complete rewrite of the runtime’s core from Zig to Rust, completed in six days using Anthropic’s Claude Code. Whether that sounds impressive or alarming depends on where you sit. Either way, the release ships a built-in headless browser, eliminates five more npm dependencies, and the follow-up patch two weeks later fixed 202 bugs and delivered HTTP/2. There’s a lot to unpack. A Million-Line AI Migration in Six Days Bun’s engineering team translated roughly 570,000 lines of Zig into 682,000 lines of Rust using Claude Code’s “dynamic workflows” — parallel agent translation with adversarial reviewer agents assigned to catch bugs, all feeding back through automated test systems. The PR reviews were conducted entirely by AI bots. No human read the full diff. The result works. Node.js compatibility jumped by 1,517 newly passing tests — the largest single compatibility leap since v1.0. In production, CPU usage dropped 2x Bun powers Claude Code, which ships to millions of users , idle CPU fell 5x, and memory consumption dropped 28–48% depending on the framework. Here’s the catch: the generated Rust code contains 13,044 unsafe blocks. A hand-written Rust project of similar size averages around 73. There are also 999+ instances of static mut — unsynchronized global mutable state that’s antithetical to how Rust is supposed to be written. The AI even left port notes in comments acknowledging the problem: “Zig used plain var globals. Mirrored here as static mut…” with a note flagging it for Phase B cleanup. The Bun team’s position is pragmatic: ship now, clean up incrementally. Their defense — that the unsafe code was always there in Zig, just invisible — is partially valid. It doesn’t fully answer what happens when a contributor needs to debug something in a 9,700-line Rust file nobody has read. That’s a future problem for a team moving fast enough not to care right now. Bun.WebView: A Browser With No npm Install Required The most novel feature in 1.4 is Bun.WebView https://bun.com/blog/bun-v1.4 , a built-in headless browser that requires zero dependencies. On macOS it uses the system WebKit. On Linux and Windows it drives Chrome, Chromium, or Edge via the Chrome DevTools Protocol — but you don’t install Puppeteer or Playwright. You just use the runtime you already have. The practical difference matters. Puppeteer’s synthetic events have always been a source of test flakiness because they bypass browser input validation. Bun.WebView generates real user input, meaning event.isTrusted is true . If you’ve ever had a test pass in Puppeteer but fail in a real browser, this is the reason. Whether it’s production-ready for complex scraping and automation at scale is still an open question. But as a zero-dependency option for lightweight tasks — screenshot APIs, rendering pipelines, simple test automation — it fills a real gap. HTTP/2 Lands in 1.4.1 Along With 202 Bug Fixes Two weeks after the initial release, Bun 1.4.1 https://bun.com/blog/bun-v1.4.1 shipped with HTTP/2 support in Bun.serve . The same port serves HTTP/1.1 and HTTP/2 simultaneously, running 6.8x faster than the equivalent Node.js setup on benchmarks. HTTP/3 remains experimental at 2.7x faster than HTTPS/1.1. Beyond HTTP, the patch fixed 202 issues. Buffer write operations improved by up to 9.2x. AsyncLocalStorage nested run calls went from 2,833ns to 57.8ns — a 49x improvement. crypto.argon2 now actually works it was previously defined but threw errors . Next.js SSR idle memory dropped from 222MB to 142MB. A day later, 1.4.2 addressed regressions that the patch introduced. Moving this fast with a freshly AI-generated codebase is a statement of intent. The regression rate is also a data point worth watching. The Dependency Elimination Pattern Every major Bun release kills off a handful of npm packages by replacing them with native built-ins. 1.4 continues the pattern: - Bun.Image replaces sharp — the package notorious for native build failures. Handles JPEG, PNG, WebP, GIF, BMP natively and runs 1.38x faster on resize operations. - Bun.cron replaces node-cron with OS-level scheduled jobs crontab on Linux, launchd on macOS, Task Scheduler on Windows . - Bun.Terminal replaces node-pty for native pseudo-terminal support. - Bun.markdown replaces most remark/marked usage with HTML, React component, and terminal rendering output. - Bun.XML replaces fast-xml-parser with a SIMD-based parser. The pattern is the strategy. Bun is not positioning itself as a Node.js drop-in — it’s positioning itself as a platform where npm install is increasingly optional. That’s a different and more ambitious bet. Should You Migrate? The honest answer depends on your stack. If you’re running Next.js 16, Fastify, Express, vitest, or any of the major ORMs, the compatibility story is strong — 99.4% Node.js API coverage with the most-used frameworks explicitly tested. The Hacker News discussion https://news.ycombinator.com/item?id=49374797 reflects genuine production adoption alongside genuine skepticism about the AI-generated core. If you’re running something niche with native C++ addons or legacy gyp bindings, you’ll hit edges. The 202-bug patch batch is evidence of real-world roughness the team is actively closing. For new projects, the case for Bun is getting difficult to argue against. Package install at 15x npm’s speed, TypeScript that runs without a build step, tests that finish in seconds, and HTTP/2 out of the box. The AI-generated Rust core is a yellow flag, not a red one — the test coverage is genuine and the performance gains are measurable. Just don’t plan to contribute to the codebase without patience and a high tolerance for unsafe blocks. Read the full technical breakdown of the rewrite controversy https://grigio.org/bun-1-4-the-controversial-ai-driven-rewrite-from-zig-to-rust/ if you want to form your own view before switching.