Live data from Hacker News

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

github.com

321–330 of 366 posts

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

#321
As a fan of Zig, and knowing that Bun is Zig's highest profile project, I am happy to hear that it wasn't this easy to excise Zig from Bun.

I guess they can just hook up the agent to Miri checks and let it grind away, and see what happens.

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

#322
post #212

Earlier quoted context omitted.

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

I was thinking of https://news.ycombinator.com/item?id=48152395. If I hadn't seen that one, I probably wouldn't have interpreted the GP this way.

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

#323

Earlier quoted context omitted.

What a terribly anti-human sentiment to have.

rooted in a long 30+ year reality. you can engineer the greatest, most secure, most accessible, most ____ thing but if it doesn’t sell those amazeballs engineers will be talking to their recruiters…

That's fine but I'll say as a human, that makes you a pretty crappy one. Only caring about monetary rewards is pathetic frankly, luckily the vast majority of humans don't agree with this sentiment and continue pushing the boundaries and our imaginations onward.

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

#324
post #272

Earlier quoted context omitted.

AI is not good at writing Rust. The ways in which it is bad vary from writing code that just looks off to actually not working. I do not use unsafe frequently so cannot comment on this particular scenario but I have seen similar stuff often, most Rust code that I read from AIs has at least one or two issues. In particular, if you have a situation that requires any kind of conceptual understanding then AI will likely…

Couldn't you say that about any code written by AI in any programming language, though? You might as well say "AI is bad at writing code".

No, the distinction with Rust is obvious from the comments on this post by people who have actually used Rust...but the features of the language are such that you need to have some deeper conceptual understanding to use those features effectively. Cpp is the same. Opus writes Rust like someone coming from Python, it is very obvious if you have a lot of hours in the lab...most people do not.

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

#325
post #315

Here's the thing: I was first interested in Bun because it was written in Zig. I was interested in Zig because I respected Andrew Kelley's decision-making, and his taste matched my own. I got really excited about Bun for many reasons after that, but they essentially came down to a similar root: the decisions were ones that I respected and would probably have made myself if I had thought of them. I was a little concer…

I can understand where you are coming from, but I myself am coming from a quite different place. I'm a long-time Deno fan, and to me Bun was less interesting because a.) it seemed like a much-less-ambitious Deno, and b.) I don't want to learn Zig, so I wasn't likely to try to hack on Bun itself, even just recreationally. But, I warmed up to Bun over the last couple years almost against my own will — trying to maintai…

> what if it doesn't suck? > And if it does suck

Why not both? How about that: perfectly fine for Anthropic but suck for everyone else.

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

#326

Earlier quoted context omitted.

> The converted unsafe rust segfaulted at the same place the C code did. It's compatible, but not safe That is indeed the point of c2rust. It gives you a baseline that is semantically identical to the original codebase, and with that passing the full test suite, bug-for-bug, you can then start gradually adopting rusty idioms to improve the memory safety of the codebase.

What comes out of c2rust is not intended for human consumption. It's more verbose than the original and harder to work on, but no safer. You lose the C idioms that people understand, while not gaining Rust idioms. It's like working on compiler-generated assembly code by hand. 2022 discussion on HN.[1] There's a DARPA funded effort called TRACTOR, Translate All C To Rust, which has funded some efforts to develop a usa…

> What comes out of c2rust is not intended for human consumption.

That doesn’t really mean anything.

> It's more verbose than the original and harder to work on, but no safer. You lose the C idioms that people understand, while not gaining Rust idioms.

Yes, and?

The value of c2rust is that you now have the entire codebase working with the rust toolchain, you’re not juggling toolchains and you’re not managing a wavefront of FFI, only a wavefront if unsafe.

C2rust is not the end, it’s the start. It’s never claimed to be anything more (the official website even mentions galois and immunant are working on tooling to convert unsafe to safe / idiomatic rust though i don’t know if that got anywhere yet).

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

#327
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…

> 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. which is somewhat close to what their port produced... like their goal was from the get to go to have a mostly exactly the same as zig "just in rust" which implies mostly unsafe rust and all the soundness/memory issues zig has (plus probably some more due to AI base…

Their zig used smart pointers and aiui the port retained those constructs.

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

#328
post #315

Here's the thing: I was first interested in Bun because it was written in Zig. I was interested in Zig because I respected Andrew Kelley's decision-making, and his taste matched my own. I got really excited about Bun for many reasons after that, but they essentially came down to a similar root: the decisions were ones that I respected and would probably have made myself if I had thought of them. I was a little concer…

I can understand where you are coming from, but I myself am coming from a quite different place. I'm a long-time Deno fan, and to me Bun was less interesting because a.) it seemed like a much-less-ambitious Deno, and b.) I don't want to learn Zig, so I wasn't likely to try to hack on Bun itself, even just recreationally. But, I warmed up to Bun over the last couple years almost against my own will — trying to maintai…

>and to me Bun was less interesting because a.) it seemed like a much-less-ambitious Deno

I don't know, I've followed Deno, and it appeared to me an incredibly low ambition from the get go.

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

#329

Earlier quoted context omitted.

They don't have to do that at all. They could've used mainline Zig, without their vibe coded changes to it.

They changed Zig because it was inadequate for their efforts, why would I keep using a tool that is inadequate if there's a better tool?

Because maybe they're wrong, and what they think is "inadequate for their efforts" is just due to their overengineering stupidity.

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

#330

Earlier quoted context omitted.

rooted in a long 30+ year reality. you can engineer the greatest, most secure, most accessible, most ____ thing but if it doesn’t sell those amazeballs engineers will be talking to their recruiters…

That's fine but I'll say as a human, that makes you a pretty crappy one. Only caring about monetary rewards is pathetic frankly, luckily the vast majority of humans don't agree with this sentiment and continue pushing the boundaries and our imaginations onward.

> vast majority of humans don't agree with this sentiment

citation needed

> and continue pushing the boundaries and our imaginations onward.

what percentage are doing it pro bono?

Post reply on HN