Bun is being ported from Zig to Rust

SergeAx 352 points 235 comments May 05, 2026
github.com · View on Hacker News

Discussion Highlights (20 comments)

heldrida

I suspect that an experiment is being run. In any case, that'll be a hell of a story!

yladiz

Why? Are there particular reasons that the maintainers of Bun feel the need to attempt to migrate from Zig to Rust?

inkysigma

So I can't tell if the linked commit is an actual attempt or just an experiment but it did always strike me as odd to make a JS runtime in Zig when my impression was there were a lot of work-stopping compiler bugs at the time.

stingraycharles

Interesting to see this when the current top post on HN is someone worrying about Bun as it was acquired by Anthropic. The top comment there describes “Anthropic does experiments on their own codebase, the Bun team is not gonna do the same vibe coding experiments”. Yet here we are, what looks like a massive undertaking for vibe coding. Time will tell how this will turn out. Would be nice if the Bun maintainers could give some clarification about what they’re doing here, and why they’re doing this.

larpa

"Claude, migrate bun to Rust, make no mistakes"

0x142857

you can use both zig and rust in a single project, duh

ConanRus

instead of writing it once in C++

Humphrey

I'll be very interested in how this AI port turns out. I am involved in a number of active projects that are being held back by the language / framework is holding back the project, but where a rewrite would be too big of a project to undertake by using only human power. I've had more success vibe coding Rust than I have in more dynamic languages. I suspect the strictness of the Rust compiler forces the AI agent to produce better code. Not sure. It could be just that I am less familiar with Rust so it feels like it's doing a better job.

jr-14

I want zig to succeed but given that zig is not yet 1.x I'd imagine a large code base like bun would have difficulties addressing major breaking changes. Also given the fact that bun is using a fork of zig https://x.com/bunjavascript/status/2048427636414923250?s=20

elffjs

Comparing this claude/phase-a-port branch with main: “Showing 1,646 changed files with 773,950 additions and 151 deletions.”

sergiotapia

>*No `tokio`, `rayon`, `hyper`, `async-trait`, `futures`.* No `std::fs`, I'm not a rust dev but even I kind of notice that tokio is kind of shunned in most projects. Why is that? Is it just bad or what?

arthurcolle

Could just be an experiment or something. It's Monday, the week is young

nothinkjustai

Makes sense on merit. There really isn’t room for Zig when Rust exists, is more ergonomic, and also safe.

hbbio

Given they have "unlimited" AI usage, do we expect the port to be complete tomorrow?

thayne

When I first heard that bun was written in zig, I thought that was an odd choice for such a large project, mostly because the language is "unstable" and is still making significant breaking changes. I would guess dealing with breaking changes is a big motivation for this.

archargelod

Linked commit is probably not the most convincing for this tagline. Here's a branch[0] of Claude mass rewriting Zig code into Rust which is currently at 773,950 additions and 151 deletions: [0]: https://github.com/oven-sh/bun/compare/claude/phase-a-port

booleandilemma

Interesting. When I thought of Zig, I thought of Bun. In my mind it was the flagship application for that language. Is there another? I wonder how the Zig team feels about this. To me it seems like Rust has definitively won now.

kgeist

Interesting how times have changed. Back in 2015, the entire Go runtime (already a mature codebase) was rewritten from C to Go semi-automatically: one of the maintainers wrote a C-to-Go conversion tool (for a subset of C they used) so that it compiled and produced identical output, and then the resulting code was manually refactored to make the Go code more idiomatic and optimized. And now you can just ask a language model. The slides: https://go.dev/talks/2015/gogo.slide#3 An interesting similarity: >We had our own C compiler just to compile the runtime. The Bun team maintain their own fork of Zig too

Entambi

hahaha eat your heart out "don't port it to rust" gang

ratstew

This feels more like a reaction to Zig's anti-LLM policy than anything. Anthropic would probably like to contribute something back to Zig at some point, but I doubt anyone would ever believe their PRs were not written by Claude.

Semantic search powered by Rivestack pgvector
8,303 stories · 78,303 chunks indexed