Live data from Hacker News

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

github.com

231–240 of 366 posts

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

#231

Earlier quoted context omitted.

strongly agreed, all of the flashiness is coming from the detractors. the port itself has been quite lowkey

Bun being a high profile project, that has had visible conflicts with Zig over AI contributions, and was recently purchased by Anthropic, is naturally going to make something like this big and flashy regardless of the author's intentions.

So Jarred unintentionally “exploited” a marketing strategy by not making a big flashy announcement (?)

c’mon.

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

#232

Earlier quoted context omitted.

> For example, Java thread execution order is UB. In this context "UB" means something different than how you're using it. The UB being mentioned here is the "nasal demons" form, i.e., programs which contain undefined behavior have no defined meaning according to the language semantics. What you're talking about is probably better described in this context as "unspecified behavior", which is behavior that the languag…

Great example. So this "unspecified behavior" might turn into the more nasal demon type when g(), h() and i() share mutable state and assume some particular sequential order of execution. No?

That would depend entirely on the assumptions being made and the constructs being used. I think in most cases it would likely just result in regular garden variety bugs.

But sure, if you're writing C++ and (for example) g is depended on for initialization of pointed memory that the other two consume you could end up with UB. But if you're writing Java then no, you will not end up with UB just buggy code.

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

#234
post #212

Earlier quoted context omitted.

[flagged]

Could you please stop posting unsubstantive comments and flamebait? You've unfortunately been doing it repeatedly. If you wouldn't mind reviewing https://news.ycombinator.com/newsguidelines.html and taking the intended spirit of the site more to heart, we'd be grateful.

this was a serious observation of the industry in 2026 lol

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

#236
post #212

Earlier quoted context omitted.

[flagged]

Could you please stop posting unsubstantive comments and flamebait? You've unfortunately been doing it repeatedly. If you wouldn't mind reviewing https://news.ycombinator.com/newsguidelines.html and taking the intended spirit of the site more to heart, we'd be grateful.

looking at my recent comment history, this was the only comment i see that qualifies https://news.ycombinator.com/item?id=48136130

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

#237

There's a book that changed a lot of the way I think about attention and media [0]. The book isn't very good, but it flags something relevant here. There is a huge asymmetry between the reach of a big, flashy announcement (here: bun was re-written in memory-safe rust in a couple weeks), and the relatively small reach of a correction (often just a footnote on an old article, here a GH issue). This asymmetry is well un…

I thought you were going to call out the problem in the other direction: There has not been a "big, flashy announcement" because the port is a work in progress. It's not done or released. The only big flashy announcements I see are these drive-by dunk attempts on the work in progress code combined with attempts to imply that they said it was done or perfect. The rewrite was a code translation meant to be a starting p…

A single million line commit overwriting all of main is pretty flashy and high profile. Anyone who was working in this repo previously can throw whatever the heck they were doing out the window. This isn't in a branch, this commit isn't marked WIP, this is now the committed, active, current state of the bun project. That's quite a statement to make, even if there isn't a blog post somewhere (yet).

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

#238

Earlier quoted context omitted.

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

What counts as "a huge deal"?

I mean, the phrase "Zig to Rust port of Bun" makes little sense even to many professional developers. They may know Rust, might have heard of Zig, very likely don't know what Bun is.

So the fact that this gets any attention at all says something.

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

#239
post #70

Earlier quoted context omitted.

> "Tbh they could've just hooked up zig translate-c to c2rust". Have you ever seen what comes out of c2rust? It's awful. It relies on a library of functions which emulate unsafe C pointer semantics with unsafe Rust. A few years ago, when I was struggling with bugs in OpenJPEG (a JPEG 2000 decoder), someone tried running it through c2rust. The converted unsafe rust segfaulted at the same place the C code did. It's com…

The module with the code mentioned is at [1] This is awful. They have some internal string format borrowed from a Zig library where the address of the item is in the low end of a pointer and the length is at the high end. Why are they doing that in 2026? It lets you save a few bytes at best. It doesn't enforce the Rust rule that strings must be strict UTF-8. It's totally alien to the safe way Rust handles strings. [1…

> It doesn't enforce the Rust rule that strings must be strict UTF-8

Judging by the name, nor should it, because OS-paths aren't always UTF-8. See for example the rust standard library type OsString https://doc.rust-lang.org/std/ffi/struct.OsString.html

The rust std library string is a reasonable default, but it's not always the right choice. Lots of projects use different things for good reasons.

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

#240

Certainly disagree with "AIs are not good at writing Rust". We can discuss the pros and cons of AI coding in general but in my experience they do just as well with Rust as any other language. If anything I'm impressed with how seamlessly the models can work with Rust's ownership model.

The kind if code they are writing is probably not what you are using Rust for.
Post reply on HN