Live data from Hacker News

Bun has been converted to rust. Now what?

bytecode.news

61–70 of 113 posts

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

#61
post #10

The irony of a post about a port primarily written by Claude having been primarily written by Claude on a website primarily designed by Claude. Come on.

To be fair, who cares about ai slop websites? To be honest, they're often better than the average webdev garbage. Language runtimes are held to a much, much, higher standard.

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

#62
post #50

Earlier quoted context omitted.

Claude (and Codex) designed the site, mostly because I'm not a UI coder; if I'd designed the site nobody'd want to read it but me, simply thanks to the UX. And I have a full-time job and more; I draft with an LLM's assistance and revise with another LLM (and other humans where possible) because I'm just arrogant enought o think that what I think might be useful to others. If it's not useful to you, I get it. Such is…

Why can't you just publish the prompt instead? Do you not see how LLMs subtly alter your original message and erase your voice? They fill gaps that didn't exist, they create syllogisms that make no sense, and the voice is now so ridiculously AIdiosyncratic that it makes my eyes boil! If you have a message that takes 100 words to say, do not use a LLM to add 400 words to it, this isn't a school assignment! Stretching…

As far as publishing "the prompt" - there's no "the prompt." The draft was put together and expanded over a set of interactions with an LLM and other people over the space of about six hours. "The prompt" would have been about twelve pages long and unreadable. Funny as heck, but unreadable.

(If you're really interested, you can check the logs in the site and find the actual interaction that started the article out. It was a comment from someone else, and it got me thinking.)

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

#63

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.

> Comparing unsafe counts to UV makes no sense here.

Agreed. The better comparison is Deno, which does roughly the same thing (wrapping a c/c++ javascript engine to create a serverside runtime). Deno was smaller, but per line of code/file it had just over half the unsafe as the bun slop rewrite. There are also examples of unsafe blocks that are just locally incorrect [0], meaning you don't even need to read outside the function and it's definition to determine that the entity doing the porting (in this case claude) didn't understand how unsafe rust works.

> I am skeptical why Bun was even an acquisition target in the first place, other than pulling stunts like this.

From what I've heard, it sounds like the author had become fully hooked by LLM coding before the acquisition, so I don't think we know enough to conclude that this was premeditated by Anthropic. I think the more likely trigger is that Bun had just bragged about how they'd forked the zig language for a performance increase and attacked zig for it's no-AI policy, only for a zig core team member to point out that the code couldn't be upstreamed even if it had been hand written [1].

The better point, IMO, is how this is an example of how AI use/addiction makes developers who fall into it loose the ability to judge code quality, particularly for code they prompted for themselves. From what I've heard of Mr. Sumner and the team at oven from before AI, I very much doubt code of this poor quality would have been allowed anywhere near the main branch before LLMs.

[0] https://github.com/oven-sh/bun/blob/d2a6506dfad4c3ef3dddb9ae...

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

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

#64
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.

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

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

#65

> 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, I'm not a Bun user myself, so my main response to that is a vaguely-interested shrug and a nod towards what seems to be the bigger issue: the use of AI to do things performatively.

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

#66

> 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.

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

#67
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.

Would you vibecode a house?

Yes, absolutely. In fact that's a big feature now in Autodesk. 99% of the design of a house is "detailing". Where does power line #8128 go? Does floor section 38 have the right slope? How big should water line #92 be and does it fit with sewage line #33 while it's sloping in the correct direction? We can't get electrical socket type 33, please modify everywhere in the design so we can use type 35 instead. And so on and so forth.

Human architects and engineers make TONS of mistakes in these designs all the time. Then builders and contractors fix them, or in many cases "fix" them, as I'm sure most people here have experienced.

Also if vibecoding houses can lead to a large increase in housing supply, as it should: Hurray!

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

#69
Posted this in a thread yesterday but seems relevant, I have been working on similar open source rewrites. Starting with Lua and Nginx. Trying to target idiomatic/ performant safe Rust from the start than straight porting and adding safety/ performance later.

- Valkey/ Redis port here https://github.com/ianm199/valdr (passes ~99% of single node test suite, real prod features like replication/ clustering/ HA early or not implemented)

- Further along port of Lua 5.1-5.5 https://github.com/ianm199/lua-rs-port/tree/main

- I have a less developed nginx version that would be the North Star

- These projects are very alpha at the moment.

The thought was that we might need many “shots on net” in terms of software safety in the future so worth exploring.

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

#70

This feels confused. The point is surely that memory-safe code can now be written, where the article seems to focus on the fact that it hasn't been yet.

Yes and no. In theory, you could start to go through an factor out unnecessary unsafe blocks from the codebase now. In practice, writing safe rust often requires significantly different design decisions than writing in garbage collected or fully manually memory managed languages, especially if you want the results to be performant. There's a very good chance you'd be better off rewriting from scratch than trying to do a 1:1 translation/port.
Post reply on HN