Live data from Hacker News

Rewrite Bun in Rust has been merged

github.com

771–780 of 822 posts

Re: Rewrite Bun in Rust has been merged

#771
post #722

Earlier quoted context omitted.

Judging by most public comments, people are really mediocre at using them. I don't get how it's possible to get such poor results from them.

That's because your usecases were simple and/or small. Otherwise, you would have known. Unless you don't have experience and you believe the whole "You are right! it _is_ a and not b" bs...

Such absolutely unfounded confidence is impressive.

Re: Rewrite Bun in Rust has been merged

#772
post #700

Earlier quoted context omitted.

Because in the software world, especially before 2022, ownership and stability have been valued. People like using things that do not randomly start breaking more often after every new release, and if things break, there is a human who knows exactly why it broke and what's the best way to fix it. Businesses would not want their losses to be attributed to an AI rewriting an entire codebase. AI owns nothing, not even t…

> Businesses would not want their losses to be attributed to an AI rewriting an entire codebase. AI owns nothing, not even the bugs which it produces. I would not want my SaaS to have downtime because a JavaScript runtime it depends on decided that they had to market their LLM by rewriting years of code recklessly. I don't know how else to say this but "Tough Shit"? Businesses are building their entire enterprise on…

You should place this energy with something like ripgrep, not a company with huge funding that actually depends on people using their product. Their whole thing is convincing you to use Bun over Node.

Re: Rewrite Bun in Rust has been merged

#773

Earlier quoted context omitted.

> Businesses would not want their losses to be attributed to an AI rewriting an entire codebase. AI owns nothing, not even the bugs which it produces. I would not want my SaaS to have downtime because a JavaScript runtime it depends on decided that they had to market their LLM by rewriting years of code recklessly. I don't know how else to say this but "Tough Shit"? Businesses are building their entire enterprise on…

You should place this energy with something like ripgrep, not a company with huge funding that actually depends on people using their product. Their whole thing is convincing you to use Bun over Node.

so...don't be convinced? Use Node if you prefer Node's governance style. Or Deno?

If they "depend" on people using their product, then surely all their paying customers will be happy to pay them whatever it costs to maintain the Zig-version-Bun that matters so dearly to them. They will see the folly of this rewrite and follow the money back to Zig.

Re: Rewrite Bun in Rust has been merged

#774

Earlier quoted context omitted.

There is never a right way, only trade offs. The thing about being a Monday morning quarterback is that you can always claim you would have used even more caution and process.

> you can always claim you would have used even more caution and process. Well, specifically, my claim is that any serious professional in this industry would have done so. But we're essentially in agreement, in the sense that yes, I am allowed to make this claim, and in fact already did, in the comment you are replying to. EDIT: Actually I've been thinking about this a bit more. The thing about commenting on somethi…

It's naive to think that only one set of trade-offs is the best one, because you can always argue for infinite process and caution.

If this Rust rewrite goes relatively smoothly, you are completely wrong about the balance of trade-offs, but you probably won't admit that because the person advocating for more process sees themself in a zero-risk win-win position:

A. The subject fails, thus you win because they should have used more process and caution.

B. The subject succeeds without more process and caution, but they should have were they a professional like you.

I see this kind of thing in the comments on social media if, idk, someone died on a hike. Psh, that's why I never walk anywhere without a week's worth of water, not even to TJ Maxx. Psh, they should have had a satellite phone; I always have one on me just in case. Psh, their satellite phone broke and they didn't have a backup one? Always carry two.

Funnily enough, your claim is worse than those examples because, unlike them, you don't even know if the rewrite failed yet. The Redditors at least waited for the person to die on the hike before they chimed in with riskless feedback from afar.

Re: Rewrite Bun in Rust has been merged

#775

Earlier quoted context omitted.

"Load bearing bugs"

It really is incredible how frequently these occur in everyday codebases of sufficient size.

We actually have a constant in our codebase to mark such bugs. You found one? Put it inside an:

    if (PREFER_EXISTING_BUGS_TO_NEW_ONES) { theOldBehavior(); }
    else { theNewBehavior(); }
Then, if we ever go to do a v2 of the thing, we can review these existing "load bearing bugs" and see if they make sense to change.

Re: Rewrite Bun in Rust has been merged

#776

Earlier quoted context omitted.

There's no reason to think there was an 'initial denial'. That's the point. Everyone here is saying there was denial because all of this happened in 9 days, and again, that's a silly assertion to make when humans did not create or review the code. Someone can have a swift turn in opinion when an incredible amount of change happens in a short time. The LoC comment I made was simply to serve as an illustration to how f…

Maybe it might be easier to understand if I was a really terrible engineer. AI gives me 750k LoC PR that's mostly broken and unuseable on Monday. AI then fixing it by adding another 250k LoC, is not going to convince me, a competent maintainer of a major Js runtime with years of contributions, plenty of downstream dependents, and an understanding of the AI zeitgeist... to merge it all in by the next Wednesday

>Maybe it might be easier to understand if I was a really terrible engineer.

Yes yes I'm sure Jarred is a really terrible engineer. Yawn.

>AI then fixing it by adding another 250k LoC, is not going to convince me, a competent maintainer of a major Js runtime with years of contributions, plenty of downstream dependents, and an understanding of the AI zeitgeist... to merge it all in by the next Wednesday

But you're not any of these things, are you? Regardless, of course you're free to not make the same decision. Doesn't really change the point.

Re: Rewrite Bun in Rust has been merged

#777

Earlier quoted context omitted.

And? This is absolutely the correct and standardized way to do mechanical rewrites: you do a rewrite that maps directly to the original source so you can rely on the original correctness guarantees and bug-for-bug compatibility and log issues, and then you go into the next phase where you begin to use idiomatic constructs. This is the same in COBOL-to-Java ports that have been done in banking and insurance for the pa…

If the rewrite was zig to C and half the code was in __asm blocks is that different or the same?

You know that it's different so why are you asking a meaningless rhetorical question.

Re: Rewrite Bun in Rust has been merged

#778
post #709

Earlier quoted context omitted.

And? This is absolutely the correct and standardized way to do mechanical rewrites: you do a rewrite that maps directly to the original source so you can rely on the original correctness guarantees and bug-for-bug compatibility and log issues, and then you go into the next phase where you begin to use idiomatic constructs. This is the same in COBOL-to-Java ports that have been done in banking and insurance for the pa…

COBOL to Java is a completely different thing and pretty much unrelated. Rust can easily call C libraries and vice versa and so can Zig. A more appropriate and designed rewrite would identify the core pieces of the Zig code that were the primary sources of all the big issues. Then, you rewrite that component in Rust and verify that you get the expected improvements. That keeps the codebase stable, it keeps you honest…

> This rewrite is totally unprofessional and has been poorly and even antagonistically communicated. The author was on this site just days ago telling everyone to relax and that he'd probably throw out this code, and that was even after it had been brought up that this wasn't pre-communicated to users.

That was until he empirically checked that, contrary to his hypothesis, Claude is _really_ good at mechanical rewrites that preserve functionality and add a type system that prevents the general class of errors that are inherent in Zig's language features, which he has mentioned previously.

I push back against the idea that you need extremely thorough analysis for certain things that end up becoming obvious after working a long time with a codebase. It's clear that Zig doesn't cover certain guarantees that make code robust but Rust does, and this has been documented over and over again because we have examples (with better and worse execution) of the classes of bugs Rust helps and uncover and how a port can go better or worse.

A language with a thorough test suite written in another language with complete coverage is about as good a use case as you can get to support a language rewrite. Ultimately this is about the developer's preference of one language over the other and avoiding simple bugs. What more do you need?

Re: Rewrite Bun in Rust has been merged

#779
post #708

Earlier quoted context omitted.

A. Transpilation is not 100% compatible because there are many idioms in some languages that cannot be directly translated to others. The lifetime system in Rust disallows a lot of constructs coming from languages with more relaxed constraints. Ironically transpilation will produce code with worse semantics than an LLM. B. At this point it's clear that LLMs reason very effectively about code and its intent. If you ha…

Push comes to shove, you could probably still ask an LLM to generate transpiler code, if you're so inclined, and then have it fix the remaining "edge cases" afterward, right…?

Transpilers have hundreds of their own edge cases, and unlike this project, there is no complete test suite of Zig -> Rust transpilation to validate your results.

Re: Rewrite Bun in Rust has been merged

#780
post #420

Earlier quoted context omitted.

I expect it will be just fine. It's like bragging about getting the words right on a mental health exam. AI was given the answer, it just repeated it back in a slightly different format. Even a stupid human could have done that.

> AI was given the answer, it just repeated it back in a slightly different format. Ridiculous.

How so? The code was already coded, the tests were already coded, the architecture was already in place. Even the help in needed to map some stuff to the new language was already coded. What did AI actually do here?
Post reply on HN