Live data from Hacker News

Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

github.com

201–210 of 366 posts

Re: Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

#201

Earlier quoted context omitted.

But nobody makes announcements and blog posts about running that.

And indeed, the bun team has not done that

Did they not make the announcement? And they definitely promised a blog post even if it's not out yet.

Re: Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

#202

This Bun rewrite feels like a potential Mythos marketing stunt.

* Spend God knows how many dollars in unlimited tokens to do the rewrite * Make a huge deal out of it how “Claude Code enabled Bun team to rewrite 1+ mil of Zig lines to Rust” and write a blogpost, VCs are salivating * Basic checks fail * Let Mythos rip the codebase to shreds, spend God knows how much more * Write a separate blogpost * Charlatans and smooth brains clap and defend against “delusional anti-AI mob” * VC…

They didn't make a huge deal about it though. I distinctly remember Jarred coming on here just last week to say stop making a big deal about it.

Re: Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

#203
post #163

After this was merged, my company made the decision to migrate everything away from bun and back to node. I don't say this lightly... Jarred is a guy that I held such immense respect for, and its sad to see the course he's charted for a project I spent a lot of time proselytizing internally. Its frankly a betrayal of trust.

I thought this was just like a fun proof of concept.. I didn’t realize they actually merged it to main. That seems pretty crazy to me. There’s no way they had time to review the code. This just seems so wildly irresponsible for such an important and high profile project.

I thought the Zig code is still in main? Both versions?

Re: Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

#204

This case is wild and seems to perfectly encapsulate all the problems people complain about with vibecoded projects. The "rewrite it in rust" commit is +1M lines of code. Humans haven't looked at that in depth. In about a week, they saw the tests passed and pushed it to main. Now people have started to look through it and are pointing out glaring issues. And the solution is just going to be "feed it to another AI and…

That happened to my project as well. The main issue hasn’t beet that ai couldn’t solve the problem, but it became so slow and you need more and more verification layers and CI/CD that at one point you wish a simpler codebase back, with reasonable tests, with storylines in codes and so on.

Re: Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

#205
post #39

Earlier quoted context omitted.

It's not surprising that a mostly straightforward translation to (partly unsafe) Rust exhibits UB. What is a bit disappointing is that the Rust code apparently has APIs that aren't marked unsafe but may cause UB anyway. When doing this kind of translation, I'd always err on the side of caution and start by marking all/most things unsafe. Or prompt the slopbots to do the same I guess. Then you can go in and verify the…

From what I read from the PR comments, the case is that the unsafe blocks behave in a way that allows for UB. This is expected, because unsafe rust can leave your program in an unhealthy state, since the language doesn't doesn't hold your hand anymore.

The point is that at a minimum you're supposed to bubble the `unsafe` up if the API does not guarantee safety is maintained for all cases (and documents the invariants that have to be kept by the caller), otherwise the system breaks down.

Re: Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

#206
post #57

Earlier quoted context omitted.

Hmmm, given the general mood in this case, I feel like there's a lot of people keen to find any criticism of the code they can and amplify it as possible. Most of it strikes me as relatively shallow at the moment, though (that is, apart from the fact that merging such a large LLM assisted port is certainly a, uh _bold_ move (to put it lightly), there's not much that people are pointing out about the actual result tha…

> Most of it strikes me as relatively shallow at the moment It is. We’re what, a week into this exercise? Absolutely everyone criticizing it, with no exceptions, is behaving like a micromanaging middle manager who couldn’t even dream of doing the work themselves. I half want to start a list of “people to ignore”, but such people tend to expose themselves in every other comment anyway.

Idk the pr author did merge it into main and talked about writing a blog post. To me that sounds like the author felt it was ready for public critique and feedback, especially for software with a fair bit of users

Re: Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

#207

Earlier quoted context omitted.

If that was true, then I would expect followups to reduce UB and unsafe in general, or at least requiring a lifetime for caller-owned memory. But I think their true strategy is to have AI produce "fixes" like these which will end up infecting the entire codebase: https://github.com/oven-sh/bun/pull/30728

exactly. If they wanted to iterate on their port they would add lifetime annotations here, which are the tool Rust be uses to ensure safety. They're just kicking the unsafety block down the road. This accomplishes nothing and is not how you get Rust to deliver its safety promise.

Unsafe code still mostly needs lifetimes. It extends the functionality, not removing them. I wonder how much nasty things they have done then.

Re: Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

#208

Earlier quoted context omitted.

Quite to the contrary to what you write, many people pushing for Rust explicitly recommend to be very restrictive about touching existing, battle tested code and only rewrite it if you're substantially refactoring it anyways, or if it is a critical exposed piece of functionality - such as media codecs for example, which have a long history of being broken. The winning strategy that for example the google android team…

> many people pushing for Rust You have couched this correctly, because we all know there are people out there who do go around yelling "Rewrite it in X" without thought (where X is the flavour of the month) I also wanted to say - your description of the /right/ way to align a project with tech X is a restatement of Martin Fowler's "Strangler pattern" Can you edit your post - "equation because deteting errors" is amb…

> equation because deteting errors

should be

> equation because detecting errors

Thanks for the catch, did the edit.

Re: Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

#209

This Bun rewrite feels like a potential Mythos marketing stunt.

* Spend God knows how many dollars in unlimited tokens to do the rewrite * Make a huge deal out of it how “Claude Code enabled Bun team to rewrite 1+ mil of Zig lines to Rust” and write a blogpost, VCs are salivating * Basic checks fail * Let Mythos rip the codebase to shreds, spend God knows how much more * Write a separate blogpost * Charlatans and smooth brains clap and defend against “delusional anti-AI mob” * VC…

And how is the Bun team supposed to work on a million lines of slop rust code?
Post reply on HN