Remix.run Logo
arp242 14 hours ago

No one has ever claimed Rust prevents all bugs. This is such a tired strawman trope.

spacechild1 10 hours ago | parent | next [-]

There a people who claim that "once it compiles, it works". I've seen this quite a few times here on HN. Just a random example: https://news.ycombinator.com/item?id=45046182

acdha 9 hours ago | parent | next [-]

That’s a far more nuanced comment than you’re portraying it as, especially as it’s appearing for exactly this scenario: the new dd is working as designed, it’s not segfaulting or corrupting data, but its design isn’t identical to the GNU version and that logic error is the kind of thing Rust can’t prevent short of AGI.

arp242 8 hours ago | parent | prev [-]

> "once it compiles, it works"

That is not a quote from that post. I am very much not pedantic about only using quotation marks for quotes as long as it reasonably accurately gets the gist right, but in this case it very much doesn't.

You are leaving out the qualified language of "generally", which completely changes what was said. And worse, the post explicitly acknowledges that it doesn't solve all bugs in the next sentence.

And even if you can dig deep and find someone using unqualified language somewhere, I'm willing to bet a lot of money that this is an oversight and when pressed they will immediately admit so (on account of this being an internet forum and not a scientific paper, and people are careless sometimes). "I like coffee" rarely means "I always like coffee, all the time, without exception".

spacechild1 3 hours ago | parent [-]

Fair enough.

tssva 12 hours ago | parent | prev | next [-]

"No one has ever" regarding human actions is quite a bold claim to make in relation to anything.

arp242 11 hours ago | parent [-]

Prove me wrong. Find someone saying that Rust will prevent all bugs.

samdoesnothing 9 hours ago | parent | prev [-]

Oh come on, tons of rust evangelicals claim that if it compiles, it works.

acdha 9 hours ago | parent | next [-]

Consider that “works without crashing” and “works the way I had in mind” are not the same thing. Rust makes it easier to avoid logic bugs but if you think bs= should do X and there should have been a spec saying to do Y, it’s not something a language can prevent.

arp242 8 hours ago | parent | prev [-]

Who? When?

Writing bugs in Rust is trivial and happens all the time. "do_stuff(sysv[1], sysv[2])" is a bug if you reversed the sysv arguments by accident. You can easily create a more complex version of that with a few "if" conditionals and interaction with other flags.

There are many such silly things people can – and do – trivially get wrong all the time. Most bugs I've written are of the "I'm a bloody idiot"-type. The only way to have a fool-proof compiler is to know intent.

What people may say is something like "if it compiles, then it runs", which is generally true, but doesn't mean it does the right thing (i.e. is free of bugs).