Live data from Hacker News

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

github.com

341–350 of 366 posts

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

#341
post #70

What I don't understand is if they were going to translate Zig to unsafe Rust, why not just build a translation tool for it? You could do a one-to-one mapping of language constructs, hardcoding patterns in your codebase, and as one friend put it "Tbh they could've just hooked up zig translate-c to c2rust". They would get deterministic translation, would probably have not been a heavy investment to build, and the outp…

> "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…

no string manipulation in C ??? this is trivial stuff guys . do you think the cpu has suddenly a different isa if you use Go? -_-. if you build unsafe code u will build unsafe code. certain logic will be solved for u and then u will fall flat on your face on the next logic u need to do yourself. why did you start programming?

its not cynical, its a real question. not trying to be mean but saying that something that people have solved countless time shouldnt be done is weird statement.

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

#342
post #67

I was a little shocked that they could get it fully working in a week to be honest. My side project is a very similar ambition ( https://tsz.dev ) but I am in no way claiming success. i keep adding more and more tests to ensure things works. Even after all of TypeScript's own tests pass I am finding bugs which I was totally expecting. The bar for matching tsc's behavior is really _really_ high. see: https://github.co…

> I was a little shocked that they could get it fully working in a week to be honest

It shouldn't be shocking, it was done using only compute, and the codebase is owned by the company who owns the compute, you literally just turn the dial up and it will be done faster. Efficacy of LLMs aside - anything they could do in 30 days they could also do in 3, if you spend more money.

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

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

[deleted]

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

#344
post #190

Things get pretty hilarious when you super safe language conrains the keyword "unsafe" :D I wonder what are the real legitimate use-cases for "unsafe" in the first place, it is there for a reason?

Me when I have literally no idea what im talking about

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

#345

Earlier quoted context omitted.

I suspect "Rust is fast/low memory utilization" is the more common value proposition, with memory safety as the bonus that can push it over other fast languages. Related: If AI writes your code, why use Python? (which notes why Rust has taken off for LLMs) https://news.ycombinator.com/item?id=48100433

Zig is every bit as fast with typically even lower memory footprint as Rust. The main thing Rust promises that Zig cannot already do natively is memory safety. This is not about Python vs Rust. It is one systems language vs another.

Notably the rewrite managed to also both reduce binary size and reduce compile time. Given it's largely a straight non idiomatic migration, that's surprising to me.

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

#346

Earlier quoted context omitted.

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.

Really? What is this reddit? If you are going to resort to name calling at least provide some genuine facts? Show me what in their Zig fork was too much? You assume Zig is “finished” being built? Because thats a bold claim, seems every major Zig change is some very major shift in the language. Zig is where Rust was before it did the borrow checker system.

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

#347

Earlier quoted context omitted.

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

It may just be different expectations about what the `main` branch means. In my organization we don't merge half-finished work into `main`.

This isn't replacing the Zig stable build at the moment - it would make no sense if it was. It's not unusual to merge separate non-prod functionality to main once something is ready for others to work on.

And realistically, essentially 100% of the people criticizing this don't have the the credentials to do so meaningfully.

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

#348
post #206

Earlier quoted context omitted.

> 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

It's not replacing the stable build, and not being claimed as bug-free. "Public critique and feedback" is not meaningful or useful if it just consists of regurgitating what's happening in a more negative and uninformed way.

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

#349
post #335

Earlier quoted context omitted.

lol — what you're saying doesn't make sense to me, but I'm sure it makes sense to somebody What I was specifically referring to is Deno (originally) trying to fix the (glaring, fundamental) problems that Node imposes on the world, vs just do them faster.

Yes, but "fixing some fundamental Node problems" is a low bar, hardly the high mark of ambition now, was it? And to offer a counter example, something like Dart appeared much more ambitious to me.

I guess it depends on how you define ambition. If you are talking about in an absolute sense, yeah of course, the Dart project had to build a whole language, VM, and ecosystem. That's way more ambitious than Deno.

Though if you look relative to the team size and resources going into it, a project like Deno can still be considered ambitious. Creating an alternative ecosystem to nodejs is a large undertaking.

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

#350
post #287

Earlier quoted context omitted.

https://tsz.dev/sound-mode/ This is awesome. Typescript really needs more of this. I hope this gets more publicized and perhaps get adopted by Microsoft. I am not sure you should call it sound mode though. > It is not a mathematical proof of soundness, and it does not make third-party .d.ts files truthful. Here there are two completely unrelated things First, soundness is a mathematical thing (sorry). If something is…

I think in the context of type systems, soundness means something like: If type system says, x has type T, then x has type T TypeScripts type system does not have that property. E.g. by default `stringArray[0]` has type `string` when it should be `string | undefined`. But TypeScript could be sound if you eliminate all these cases. If that's the goal of "SoundMode" then the name sounds fair to me. Not even sure `.d.ts…

> But TypeScript could be sound if you eliminate all these cases. If that's the goal of "SoundMode" then the name sounds fair to me.

Agreed. But it isn't the goal of the sound mode. It's still unsound from a type theory point of view, just with fewer holes

Post reply on HN