Live data from Hacker News

Rewrite Bun in Rust has been merged

github.com

691–700 of 822 posts

Re: Rewrite Bun in Rust has been merged

#691

So how many of their employees are now familiar with the codebase? zero?

I mean if you look at the code, it's a pretty faithful rewrite. It seems like being near 1-1 with the original code was prioritized even more so than utilizing Rust's safety features since unsafe Rust is everywhere

Re: Rewrite Bun in Rust has been merged

#692
post #32

Earlier quoted context omitted.

> "The codebase is otherwise largely the same. The same architecture, the same data structures."

Ship of Theseus.

except it's more like someone used the Philosopher's Stone to turn all the wood bits into metal

Re: Rewrite Bun in Rust has been merged

#693

Earlier quoted context omitted.

Yeah I don’t know what’s true when reading about LLMs. Same with comments here on hacker news. So much money on the line it’s clear they would seed communities with marketing shills (and some people are just tribal). Same since they own Bun, they have every incentive to make this seem easier than it was.

You can just use AI for yourself and see. It isn't some mysterious product that only a few people get to use.

This is the thing. I do use LLMs (mostly Anthropic).

It just does not generate good useable code. I have to review every single change to a higher degree than I would my own code because it likes to slip in hidden nasties. I have to rewrite at least 50% of what it generates.

That being said, I know devs who swear that they don’t even write code anymore. Like this rust port. I can’t even fathom blindly merging something his massive.

Re: Rewrite Bun in Rust has been merged

#694
This is a massive marketing for Anthropic. It shows how capable their systems to enterprises customers.

Also this is a perfect task for LLMs. They have the most detailed spec (Production Zig code) ever, and since it as file for file and line for line rewrite, agents were able to quickly complete a massive 1 Millon line rewrite.

We will continue to see more of these in future.

Re: Rewrite Bun in Rust has been merged

#696
post #368

When announcements say that rewrite took 1 week, I wonder how much time went into preparing this file with very detailed instructions on mapping Zig to Rust idioms: https://github.com/oven-sh/bun/commit/46d3bc29f270fa881dd573... On top of that, if you look at 'Pointers & ownership' and 'Collections' sections, the Bun codebase is already prepared, using internal smart pointer types that map 1-to-1 to Rust equivalents,…

Based on the use of "≥" and em-dashes, I'd say this markdown file was written with or by an LLM.

Re: Rewrite Bun in Rust has been merged

#697

Earlier quoted context omitted.

How would you have achieved this “machine translation” without an LLM? It seems to me it would have been highly likely to be more expensive and more resource intensive - if realistically possible at all, short of implementing a general Zig to Rust translator first.

"Short of..." indeed. You already know the answer, although it doesn't need to be general ; it only needs to work on a single codebase. A recent and highly relevant example is the migration of the TypeScript compiler to Go. They did not use an LLM to translate the code. Instead, they used LLM assistance to write a deterministic TypeScript-to-Go translator and then used that to translate the code. I have far more conf…

I think TypeScript to Go is far easier to translate than something to Rust though.

Re: Rewrite Bun in Rust has been merged

#698
post #249

$ rg 'unsafe [{]' src/ | wc -l 10428 $ rg 'unsafe [{]' src/ -l | wc -l 736 Language Files Lines Code Comments Blanks ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Rust 1443 929213 732281 116293 80639 Zig 1298 711112 574563 59118 77431 TypeScript 2604 654684 510464 82254 61966 JavaScript 4370 364928 293211 36108 35609 C 111 305123 205875 79077 20171 C++ 586 262475 217111 19004 26360 C Header 779 100979…

Better to know where memory bugs may happen than them being everywhere. Also, bun team are looking it to reduce it by a large margin. Since it was a line by line port, there is a good space for improvement. By first rust release, a significant number of it should be resolved.

Re: Rewrite Bun in Rust has been merged

#699

“+1,000,000” changes in a single commit is insane.

Why would they do it like this? It makes no real sense to me. At that point it's an entirely different project, with the same functionality.

If you use Bun in production, does this feel like a well managed upstream?

I don't use Bun, I don't care that they are using an LLM (though it is impressive that this actually worked), but the project management aspects of this is just wacky.

Re: Rewrite Bun in Rust has been merged

#700
post #539
post #135

Earlier quoted context omitted.

You, nine days ago[0]: > I work on Bun and this is my branch > This whole thread is an overreaction. 302 comments about code that does not work. We haven’t committed to rewriting. There’s a very high chance all this code gets thrown out completely. Maybe... it wasn't such an overreaction? [0]: https://news.ycombinator.com/item?id=48019226

I'm really out the loop here so maybe you can help answer me a question - why is HN unhappy about this rewrite? why are people writing here almost as if they feel betrayed by Bun being rewritten from Zig into Rust? I genuinely don't get it. I've been following this Bun stuff a bit but I don't understand where the HN sentiment is coming from.

Because in the software world, especially before 2022, ownership and stability have been valued. People like using things that do not randomly start breaking more often after every new release, and if things break, there is a human who knows exactly why it broke and what's the best way to fix it. Businesses would not want their losses to be attributed to an AI rewriting an entire codebase. AI owns nothing, not even the bugs which it produces. I would not want my SaaS to have downtime because a JavaScript runtime it depends on decided that they had to market their LLM by rewriting years of code recklessly.

People are not betrayed by a rewrite. They are betrayed by an LLM rewriting with minimal supervision fasttracked to a merge within 9 days of commencement.

To the contrary I do not understand how we have become so insensitive towards stability since the LLM era. Why is unbreakable code no longer the goal but a truckload of generated code is.

Post reply on HN