Live data from Hacker News

Bun has been converted to rust. Now what?

bytecode.news

21–30 of 113 posts

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

#22

Bun was ported from Zig to Rust by an LLM and passed nearly all its tests - while shipping more than ten thousand unsafe blocks. Memory safety is the main reason you'd pick Rust. So what did the rewrite actually accomplish?

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.

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

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

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

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

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

If it has tests and responsible management, sure why not. I generally feel more comfortable if something is 1) widely used & scrutinized 2) managed competently. But that's orthogonal to how (not if) people use AI. Having good tests, reviews, etc. is much more important.

Do people trust random NPMs developed by random people on the internet? Apparently we do given all the recent issues with supply chain attacks.

I have a problem with people using vibe coding to refer to any contribution for which AI is used. I think it is inaccurate. People providing very low quality contributions to projects is a problem. But the real problem is people accepting such contributions.

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

#25
post #14

> There is a small, ironic coda. The follow-up PR to delete the 600,000 or so lines of leftover Zig was titled, by Sumner, "ai slop." GitHub's automated anti-slop detection - built to flag exactly the kind of AI-generated mass change this was - caught it and auto-closed it. The author named his own cleanup slop, and the platform's tooling agreed. That looked suspicious to me (you could almost say hallucinated...), so…

Humans can make errors; part of why I waited so long to write and post this is because I'm not a great Rust coder (at all) and I don't use Bun, so I felt like I lacked enough relevant insight to say anything, and this is part of that, I think.

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

#26

Bun was ported from Zig to Rust by an LLM and passed nearly all its tests - while shipping more than ten thousand unsafe blocks. Memory safety is the main reason you'd pick Rust. So what did the rewrite actually accomplish?

For one, you now know exactly where the memory unsafe code is, rather than a cloud of suspicion hanging over every line of the codebase.

Sure, as long as all the code in all those unsafe blocks is sound! If not, the program is UB and all bets are off for every line of the codebase.

I think Rust strikes a perfect balance between a safe default and, as you say, "localized unsafety". Said localized unsafety is however only localized as long as you're "doing it right". I would absolutely not trust an LLM to do it right for hundreds of thousands of lines of translated code. This is insane.

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

#27
post #9

Bun was ported from Zig to Rust by an LLM and passed nearly all its tests - while shipping more than ten thousand unsafe blocks. Memory safety is the main reason you'd pick Rust. So what did the rewrite actually accomplish?

- A substantially simpler, more-contained build process - A base from which to build upon by removing unsafe blocks

> - A base from which to build upon by removing unsafe blocks

This is nonsense if those unsafe blocks are unsound to begin with.

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

#28

Bun was ported from Zig to Rust by an LLM and passed nearly all its tests - while shipping more than ten thousand unsafe blocks. Memory safety is the main reason you'd pick Rust. So what did the rewrite actually accomplish?

I see comments like this and they seem so pointless. The port was done in a week. Do you think the development is finished? Obviously there are some unsafe blocks that will remain forever unsafe. But other will eventually be removed.

Just a bunch of fearmongering

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

#29

Bun was ported from Zig to Rust by an LLM and passed nearly all its tests - while shipping more than ten thousand unsafe blocks. Memory safety is the main reason you'd pick Rust. So what did the rewrite actually accomplish?

> So what did the rewrite actually accomplish?

Hype.

On an aside, isn't Zig supposed to have much faster compile times than Rust, and didn't they give that as the main reason Zig wasn't working for them and why they wanted to switch to Rust?

The whole thing seems insane. I don't know why anyone would switch to Rust for any reason besides the obvious: to get REAL memory safety.

If you're doing that... You wouldn't wrap ~90% of your important code in `unsafe` blocks.

You're doing a ton of work for virtually no benefit, and - if anything - a lot of negatives.

Everything I've read and heard about this port raises more questions than answers, and not in a good way.

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

#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.
Post reply on HN