Live data from Hacker News

Bun has been converted to rust. Now what?

bytecode.news

81–90 of 113 posts

Re: Bun has been converted to rust. Now what?

#81
post #22

Earlier quoted context omitted.

Were "passing tests" also generated by the same LLM? This is much different from how Ladybird team handled a rewrite: https://news.ycombinator.com/item?id=47120899

> Were "passing tests" also generated by the same LLM? No. The useful thing about porting a language runtime is that most of the tests are written in the language that it's a runtime for, not the implementation language. It's very easy to catch if the coding agent rewrites those tests.

I heard that Bun is not just a JS runtime, but much more than that. JavaScriptCore (JS engine Bun uses) is property tested outside of Bun anyways, what about other stuff?

Re: Bun has been converted to rust. Now what?

#83
post #30

Couple of notes here: - This is blatantly irresponsible, and killed any credibility this project has - Comparing unsafe counts to UV makes no sense here. - There is already a strong, safe runtime that's not vibe coded, called Deno, that more people need to check out. - I am skeptical why Bun was even an acquisition target in the first place, other than pulling stunts like this.

Claude Code uses Bun.

Why didn't they just rewrite Claude Code in Rust, and save everyone else the trouble of becoming the subject of their dramatic public experiment.

Re: Bun has been converted to rust. Now what?

#84
post #64

Earlier quoted context omitted.

Depends on who vibe codes it. At the end of the day the Bun developers are the ones responsible for the quality of their software. If they've reviewed the code closely, tested it, and eat their own dog food, then I don't see why I should treat it any different from any other untrusted 3p dependency. IMO, the main problem with vibe coding is that it empowers reckless behavior at companies like Microsoft, and that peop…

They obviously haven't closely reviewed the code. That's the point

Why is that obvious? Wouldn't surprise me either, but I don't think it's obvious, unless I missed some "confession" or something.

Re: Bun has been converted to rust. Now what?

#86

> The Rust rewrite passed 99.8% of the existing test suite. That number is enormous and significant, but let's be precise about what it actually says I'm having a hard time even loading the PR, so can't look myself... But I seem to remember that there was changes to the test suite as well as the rewrite to the Rust engine, that would mean this number may or may not actually be accurate. Anyone remember or could actua…

If I recall correctly - and I might not - the process found places in the test suite that were wrong or lacked clarity, and the suite was modified slightly in a few places to actually fix things that needed fixing. I don't think it was a broad enough change to actually significantly affect the coverage to a real degree, but then again, that WOULD be a good thing to dive into the PR to check - and as I've pointed out,…

In what sense was Bun's rewrite performative? If I recall correctly, Jarred deliberately tried to fly a bit under the radar to prevent the inevitable outcry

Re: Bun has been converted to rust. Now what?

#87

> For scale: uv, a Rust project of broadly comparable size from the same general corner of the ecosystem, contains 73. As a point of information: uv's use of `unsafe` largely involves interactions with OS APIs that don't have safe wrappers yet (in practice, this is mostly Win32 and similar APIs). It makes sense that Bun would have more `unsafe` than uv does, insofar as it needs to interact with JavaScriptCore's C API…

Bun has about twice the density of `unsafe` compared to deno, which does roughly the same job (wrap a c/c++ javascript engine to make a server side runtime written in rust). So not as massive a difference as the linked post's comparison, but still significantly more unsafe than we'd expect.

I haven't heard that number before and I'm actually impressed.

For a file-by-file close to literal translation of a memory-unsafe language to Rust, isn't that pretty good?

I was expecting the post-rewrite Bun's unsafe usages to be in the order of magnitude of C2Rust (https://c2rust.com/). I was _not_ expecting it to be in the same ballpark as hand-written Rust.

Re: Bun has been converted to rust. Now what?

#88

Earlier quoted context omitted.

Bun has about twice the density of `unsafe` compared to deno, which does roughly the same job (wrap a c/c++ javascript engine to make a server side runtime written in rust). So not as massive a difference as the linked post's comparison, but still significantly more unsafe than we'd expect.

I haven't heard that number before and I'm actually impressed. For a file-by-file close to literal translation of a memory-unsafe language to Rust, isn't that pretty good? I was expecting the post-rewrite Bun's unsafe usages to be in the order of magnitude of C2Rust ( https://c2rust.com/ ). I was _not_ expecting it to be in the same ballpark as hand-written Rust.

I'm not sure I'd classify "double" as "the same ballpark", but either way C2Rust appears to just mark everything as `unsafe` (even when it's completely unnecessary), so I don't think that's a fair comparison. Further, I know for a fact that their are instances of the `unsafe` in the bun codebase right now that are just trivially incorrect in rust. A vaguely competent human programmer, even one doing a 1:1 translation (which is likely a bad idea anyway) would have caught those.

Re: Bun has been converted to rust. Now what?

#89

Earlier quoted context omitted.

If I recall correctly - and I might not - the process found places in the test suite that were wrong or lacked clarity, and the suite was modified slightly in a few places to actually fix things that needed fixing. I don't think it was a broad enough change to actually significantly affect the coverage to a real degree, but then again, that WOULD be a good thing to dive into the PR to check - and as I've pointed out,…

In what sense was Bun's rewrite performative? If I recall correctly, Jarred deliberately tried to fly a bit under the radar to prevent the inevitable outcry

In the sense that while there was a positive outcome ("We moved to Rust, which solved our issues with Zig no longer accepting AI-assisted content" - a projection on my part, but one I think makes sense) without an actual contribution that one would expect.

It's in Rust! That means Rust's memory safety applies! ... except as a direct port, it doesn't, it's got Zig's memory semantics in Rust-shaped code. As others have pointed out (including me, FWIW) that's something that can change... but it's not a simple thing to accomplish, and it may ALWAYS be a Zig-shaped skeleton in a bag of Rust.

Re: Bun has been converted to rust. Now what?

#90
post #3

Deno was already implemented in Rust, and not done by vibe-coding. Would you trust a fully vibe-coded runtime? Not some features, not some fixes, but a full translation from one language to another.

Another great example of Averse Ai Behavioral Syndrome

If y'all ever wondered how your dads got sucked into alt right talkshows and radio, just read ops comment in Tucker Carlson's voice.

Post reply on HN