Industry Commentary

What Bun's Rewrite in Rust Says About Runtime Engineering in 2026

By John Jansen · · 7 min read

Share

When a runtime as visible as Bun announces a rewrite of its core from Zig to Rust, the temptation is to read it as a tribal story — one language winning, another losing. That framing misses the more interesting signal. Runtime authors make these decisions with their eyes open, after years of living inside the consequences of the first choice. What changed isn't taste. What changed is the cost structure of building a serious runtime in 2026.

We've spent enough time embedded in infrastructure work — both writing it and integrating with it — to think the Bun move is worth reading carefully. It says something specific about where the floor has moved for systems software, and what that means for anyone shipping a runtime, a database, a proxy, or any long-lived process that other people depend on.

The original Zig bet was rational

It's worth being honest about why Zig made sense in the first place. When Bun started, the team needed a low-level language with predictable performance, comfortable C interop (critical for embedding JavaScriptCore), manual memory control, and a compilation model that wouldn't get in the way of a small team moving fast. Zig delivered on all of that. It is genuinely pleasant to write, the comptime story is elegant, and the lack of hidden control flow makes performance work tractable.

The trade was ecosystem and guarantees. Zig in 2022 was pre-1.0, the standard library was in motion, the package story was nascent, and memory safety was the programmer's job — same as C. For a small team writing a runtime where every allocation matters, those trades were acceptable. The runtime authors were the only people writing Zig in the codebase, and they could hold the whole memory model in their heads.

What changes after a few years of success is everything downstream of that. The codebase grows. New contributors arrive. The surface area expands from "run JS fast" to "be a package manager, a bundler, a test runner, a SQL client, an S3 client, a WebSocket server." Each of those subsystems has its own memory lifecycle. Each one is a place where a use-after-free can land in production for someone else.

Memory safety is now a product feature

The quiet shift in our industry over the last three years is that memory safety has stopped being a language-nerd concern and started being something procurement teams ask about. CISA, the NSA, and the White House ONCD have all published guidance pushing memory-safe languages. Microsoft and Google have both published data showing roughly 70% of their security vulnerabilities trace to memory safety issues. Android's switch to Rust for new code dropped memory bugs in those components dramatically.

This matters for a runtime in a way it doesn't for an application. A runtime is a multi-tenant trust boundary. It parses untrusted input — HTTP requests, JSON payloads, user JavaScript that calls into native APIs. A use-after-free in your fetch implementation isn't a crash bug, it's a remote code execution waiting for someone curious enough to find it. When you're competing with Node and Deno for adoption inside companies whose security teams have opinions, "we have a memory-safe core" stops being a slide and starts being a checkbox.

Rust gives you that checkbox in a way Zig, today, does not. Not because Zig couldn't — the language has interesting ideas about allocator-passing and lifetime tracking — but because Rust's borrow checker is the only mainstream tool that mechanically enforces it at compile time across a million-line codebase contributed to by people you've never met.

Ecosystem gravity is real and it compounds

The second pressure is more mundane but probably mattered more in the decision. The Rust ecosystem in 2026 is what the C++ ecosystem was in 2010, except it actually works. Tokio, hyper, rustls, quinn, h2, h3, rkyv, serde — these are battle-tested libraries that you can drop into a runtime and inherit years of correctness work from. Cloudflare's pingora, AWS's s2n-quic, the entire async networking stack used by half the new infrastructure shipping today is Rust.

For a runtime, that's leverage. Every protocol you'd otherwise implement yourself — HTTP/2, HTTP/3, TLS 1.3, QUIC, the next thing — already exists, has been fuzzed by people whose full-time job is fuzzing it, and gets security patches from a maintainer who isn't you. Choosing Zig meant either writing those yourself or carefully wrapping C libraries. Choosing Rust means cargo add and getting back to the actual problem.

This is the unglamorous reality of runtime engineering: most of your code is not the hot path. Most of your code is parsers, protocol implementations, glue, and edge cases. The hot path you can hand-tune in any language. The other 95% benefits enormously from a mature library ecosystem.

Maintainability over a decade

The third factor, and the one we'd weight most heavily if we were making the call, is the ten-year horizon. A runtime is a multi-decade commitment. Node is sixteen years old. V8 is seventeen. JavaScriptCore traces back to 2002. If you're building something to compete in that category, you're not optimising for the next release — you're optimising for the engineer who joins the project in 2031 and needs to fix a bug in code nobody who wrote it still works on the project.

Rust's strictness is actively unpleasant in the first month and quietly invaluable in year five. The type system encodes invariants that would otherwise live in tribal knowledge. The borrow checker prevents categories of bugs that, in a Zig or C codebase, would require careful code review by someone who understands the allocator strategy of that subsystem. For a project that wants to scale contributors beyond the founding team, this is the difference between linear and sub-linear contribution velocity over time.

What this means for the rest of us

If you're building infrastructure software in 2026, the Bun decision is worth treating as a data point, not a fashion signal. Some honest reads:

  • For greenfield runtimes, proxies, and databases: Rust is now the default conservative choice. Not the exciting choice — the boring one. Picking anything else requires a justification you'd be comfortable defending to a security review.
  • For existing systems in C or C++: Incremental migration to Rust at trust boundaries (parsers, network I/O, crypto) is well-trodden. The Linux kernel, Firefox, and Chromium are all doing versions of this. The tooling for FFI-heavy hybrid codebases is mature.
  • For Zig: This isn't a death sentence — Zig remains an excellent language for projects where a small team owns the entire codebase and ecosystem size doesn't matter. Game engines, embedded work, single-author tools. But for sprawling systems software with security boundaries and many contributors, the calculus has shifted.
  • For application developers: Mostly this doesn't affect you, except to say that the runtimes you depend on are quietly getting more defensible. That's good.

The Bun rewrite isn't a story about Rust winning. It's a story about what it now costs to ship serious infrastructure that other people will trust with their production traffic. The bar for memory safety, ecosystem leverage, and contributor scalability moved, and a team that had every reason to stay put decided the rewrite was cheaper than the alternative. That's the signal worth reading. The language is just the vehicle.

Want to discuss this?

We write about what we're actually working on. If this is relevant to something you're building, we'd love to hear about it.