Top
Best
New

Posted by SergeAx 8 hours ago

Bun is being ported from Zig to Rust(github.com)
477 points | 336 commentspage 3
elffjs 8 hours ago|
Comparing this claude/phase-a-port branch with main: “Showing 1,646 changed files with 773,950 additions and 151 deletions.”
jedisct1 2 hours ago|
And of course, everything was carefully reviewed by a human.
thayne 7 hours ago||
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.

cropcirclbureau 7 hours ago||
The only Bun shipped product I've used in anger is OpenCode and I regularly run into segfaults on it. I doubt this is the reason for migration but every time it happens, it reminds me the real cost of unsafe code. That being said, Zig is an absolute pleasure to write and I can't wait until it has a real library ecosystem, Rust's greatest boon.
mswphd 7 hours ago|
the rust port (at least currently) heavily uses unsafe as well

https://github.com/oven-sh/bun/compare/claude/phase-a-port#d...

that isn't particularly surprising, but the point is I would expect getting things more stable than the zig version would take a bit.

xiphias2 1 hour ago||
That's completely normal at the first step of the language transformation. Actually it's required if you do a file by file transformation first while wanting to maintain interface compatibility.

I'm not sure I would take this kind of path, I would much more focus on refactoring the project to small and easily translatable components with small boundaries, but it's cheap to try things.

bijowo1676 5 hours ago||
Its never been easier to rewrite X in Rust than today.

Will everything eventually be rewritten in Rust and we finally achieve utopia?

vrighter 2 hours ago||
why would we need to rewrite twitter in rust? (sorry, couldn't resist)
zelphirkalt 3 hours ago||
... or will it all rust away?

OK I'm sorry, I'll see myself out.

toledocavani 7 hours ago||
For better or for worse, at least Bun is open source, and the world is not lacking a NodeJS alternative.

What is the most interesting here for me is:

- a big, clear outcome and acceptance criteria, vibe coding project on

- a public, working, high performance, full featured, production codebase by

- the leading LLM model maker known for the strongest coding ability

A good example no matter if it successes or not.

anymouse123456 7 hours ago||
This is a huge loss for the zig language and community.

As a fan of the language, I hope it leads to some reflection on things that might need to change moving forward.

Capricorn2481 6 hours ago|
I think it reflects more on Bun. [1].

[1] https://ziggit.dev/t/bun-s-zig-fork-got-4x-faster-compilatio...

Petersipoi 6 hours ago||
Bun is the largest project written in zig. And it isn't close. Bun is bigger than zig itself. Seems like zig isn't mature enough to handle Bun's needs, so I don't blame them at all for looking for off ramps. Only time will tell if rigidity from the zig team is worth the cost of losing Bun. It might be.
toshinoriyagi 4 hours ago|||
Zig won't be affected by Bun potentially moving to Rust, the language has been growing rapidly and one of the main proposals of Zig is "maintain it with Zig". It's ability to integrate with existing C code bases, as well as be a drop-in build replacement, has widespread use.

In addition, the link in the comment you replied to explains why the PRs Bun opened to Zig would have lowered the quality of the compiler and how Zig has achieved even greater speedups, with more widely applicable features like incremental compilation and the self-hosted backend.

kigiri 2 hours ago|||
It is definitly worth it, and moving to rust because compile times are too slow ? This can't be the main reason for the switch
heldrida 8 hours ago||
I suspect that an experiment is being run. In any case, that'll be a hell of a story!
born-jre 2 hours ago||
Let the guy cook, would be nice benchmark of llm nothing else. Damn I wish I had access to infinite tokens for crazy experiments like this.
classicposter 6 hours ago||
https://github.com/oven-sh/bun/issues/30197

It seems there was an issue where the image API ignored the ICC Profile.(now fixed) Any developer with experience implementing image formats would almost certainly avoid this mistake. This is a problem that cannot be solved with vibe coding. In this situation, the user is merely a guinea pig for bug fixes.

simonw 6 hours ago|
... and that bug was spotted in the canary release, reported and fixed.

Sounds like responsible open source software development to me. That's what pre-releases are for.

holysantamaria 2 hours ago|
Maybe Mythos told them to quit using zig because it is not safe
More comments...