A bug-for-bug port to Rust is the first step to fixing that. Assuming the port is actually 1:1 without any behavioral changes, these bugs already exist in the Zig code. The difference is now it's known where effort can be dedicated in order to one day have a memory-safe release of Bun. People have absolutely lost their mind over this and completely forgotten the benefits Rust gives you. I feel like I've gone back 10 years reading threads about the Rust port of Bun these are the exact same arguments we see from people advocating continued use of C++.

> Assuming the port is actually 1:1 without any behavioral changes, these bugs already exist in the Zig code

The "1:1" assumption is a massive unjustified assumption. Rust and Zig have different memory models, so it's possible to do a "1:1" translation of Zig code to Rust and end up with undefined behavior in Rust.

For example, Zig code might make assumptions about lifetimes based on implicit knowledge of which allocator was used for some memory. That could cause problems in Rust if you erase the lifetime https://github.com/oven-sh/bun/blob/main/src/bun_core/string...

> Assuming the port is actually 1:1 without any behavioral changes

It's not, that's clear from this kind of bug popping up. Functionally this bug exists because `PathString` was converted into a "safe" Rust API but still works the same internally as the original Zig code did (via using `unsafe`), that introduces UB that wasn't there in the Zig code.

If it was attempting to be a 1:1 with no behavior changes (like c2Rust attempts to do) then this would not have been turned into a "safe" Rust API like this.

Its almost like AI is rotting our brains?

[flagged]

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 pursues is to not rewrite existing code, but write all new code in Rust, because real-world data shows that vulnerabilities in existing code follow a decay curve - most issues are detected in the early life of the code. That's the strategy that Firefox uses, too. (Though I'm curious about how LLMs change that equation because detecting errors in rarely used code path' seems to be what they're doing well)

And indeed, this is very much what Rust was designed to do with the ability to interface with existing C/C++ code in both directions. So this is the strategy that the designers of the language had in mind from the early days. It's a deliberate choice to offer this, and not an emergent property that was later discovered.

> 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 ambiguous - deleting, or detecting - I cannot work out which you mean

> equation because deteting errors

should be

> equation because detecting errors

Thanks for the catch, did the edit.

And yet, all I ever see are attacks against these convenient bogeymen with artistic exaggerations like yours... but I never see the bogeymen themselves.

You've never seen the Rust evangelists?

I am genuinely jealous.

Also, I know you made a typo, but it did make me laugh

Bogeymen is what you meant

Boogymen reminds me of the joke in Millenium Man (How do you make a handkerchief dance - put a little boogie in it)

I actually have not, for real. And I keep getting beaten up here on HN just for daring to say it.

Makes you think who is who in this situation. Bullies screaming they are the victims.

The only time I've ever seen anything that could be considered Rust evangelist is when someone with a chip on their shoulder shoves a github issue or random comment link in my face. I certainly don't encounter them in the wild.

You're right - Rust has never had tech evangelists, absolutely never

In fact it's the only technology known to humans to never have had any such thing.

Puhleease.

A quick scan of your comment history suggests that you see one every day ;)

And - the number of times I have been grossly downvoted for daring to utter a true word about Rust (or even Rust adjacent) will let you know your non-existent Rust evangelists are indeed the bullies - with one now screaming that he is a victim.

If you want definitive proof - look at this sub thread where you're so triggered that people talk about the mere existence of Rust evangelists (and evangelists exist for every tech - they always have and always will - which you would know given your [claimed] history in the field) that you want to argue they they aren't evangelists, they're just poor misunderstood victims.

Note: I say claimed not as a jab but because I don't know you and can only go on your claims in your profile.

My comment history? The very same one that keeps trying to extract out the location of those supposed Rust zealots and never even getting a single response except yesterday... and the linked comment was pretty mild? But I always get downvoted for having the gall to ask? That comment history?

Surely you mistyped that part of your comment with the one I wrote above, right? Understandable.

I guess we'll have to agree that we live in parallel realities though, reading your comment -- which I do find genuinely puzzling. Because I keep not seeing evangelists and the only one using troll-like language here is you, not me ("triggered", really?).

I am looking at the sub-thread. I guess I need new glasses. Still not seeing anyone fanatical / zealot or whatever. What I see are people who try to ground a discussion because a top comment happily tears down a straw man, and those comments are attempting to show that.

> Note: I say claimed not as a jab

Oh, I am sure. Your comment absolutely cannot be mistook for that.

Just a final post

"No true Scotsman" detected

and

>> Note: I say claimed not as a jab

> Oh, I am sure. Your comment absolutely cannot be mistook for that.

I made an explicit note because I suspected that you were going to take it as such (and, as demonstrated by the sarcasm in your response, you did)

Have a nice day bud - nobody has changed their mind - it's been real.

You are reaching and trying too hard to find bogeymen where they don't exist, that's my conclusion.

Be more awesome, dude. :)

Also yeah, serves me right for trusting my phone's keyboard. :(

Editing the comment out now, thanks for pointing out the typos!