Live data from Hacker News

“Rust is safe” is not some kind of absolute guarantee of code safety

lkml.org

111–120 of 542 posts

Re: “Rust is safe” is not some kind of absolute guarantee of code safety

#111

As usual HN comments react to the headline, without reading the content. A lot of modern userspace code, including Rust code in the standard library, thinks that invariant failures (AKA "programmer errors") should cause some sort of assertion failure or crash (Rust or Go `panic`, C/C++ `assert`, etc). In the kernel, claims Linus, failing loudly is worse than trying to keep going because failing would also kill the fa…

Then Linus is wrong because the unsafe keyword has nothing to do with no-panic guarantees? Unsafe correlates with memory safety / UB, so using it in a different way in the kernel would be flat out wrong.

The language determines the definition of its constructs, not the software being written with it.

Edit: It's worth mentioning that while I think he is wrong, I think it's symptomatic of there not being a keyword/designation in Rust to express what Linus is trying to say. I would completely oppose misusing the unsafe keyword since it has negative downstream effects on all future dependency crates, where it's not clear what characteristics "unsafe" refers to which causes a split. So maybe they need to just discuss a different way to label these for now and agree to improve it later.

Re: “Rust is safe” is not some kind of absolute guarantee of code safety

#112
post #61

> And the reality is that there are no absolute guarantees. Ever. The "Rust is safe" is not some kind of absolute guarantee of code safety. Never has been. Anybody who believes that should probably re-take their kindergarten year, and stop believing in the Easter bunny and Santa Claus. I thought that he had apologised and regretted being hostile in comments. Apparently not. Not that I have much of an issue with ranty…

I think he does make a good point about the wrong answer sometimes being better than a panic. I assumed rust in the kernel would be compiled with no-panic.

Re: “Rust is safe” is not some kind of absolute guarantee of code safety

#113
post #70
post #61

> And the reality is that there are no absolute guarantees. Ever. The "Rust is safe" is not some kind of absolute guarantee of code safety. Never has been. Anybody who believes that should probably re-take their kindergarten year, and stop believing in the Easter bunny and Santa Claus. I thought that he had apologised and regretted being hostile in comments. Apparently not. Not that I have much of an issue with ranty…

Why are so many people criticizing Linus? This post strikes me as relatively moderate. Other software dictators do exactly the same, but in a more underhanded and bureaucratic manner, which is worse. Yet their disciples call them "benevolent". I can deal with Linus, but not with the latter. Linus strikes me as not being really serious or vindictive. It's just a colorful way of expressing himself.

because people of modern age have to destroy everything's good, to feel better about themselves, without having to actually be good.

Re: “Rust is safe” is not some kind of absolute guarantee of code safety

#114

Why is panicing in the kernel on an error not an option? Like kernels can write a core dump and reboot, right?

Yeah ... Just reboot the machine and make me loose all my work, bro.

This is why programs automatically saving their state is important.

Re: “Rust is safe” is not some kind of absolute guarantee of code safety

#115
post #68

Classic Linus. From the closing paragraph, I feel like he’s under the impression that Rust-advocating contributors are putting Rust’s interests (e.g. “legitimizing it” by getting it in the kernel) above the kernel itself.

They probably are, in many cases. Rust’s community, in aggregate, have developed a reputation (earned, in my opinion). It’s too bad that the community don’t follow the leaders’ example in this regard. There are some quality, level-headed Rust advocates. They appear to be the minority.

At least they don't go around slandering programming language communities.

If we're going to be serious about who is being toxic, it's definitely Linus in this thread. Guy makes first mistake (by a very broad interpretation of "mistake". Perhaps "misunderstanding"?). Linus goes nuclear. And while his reasoning is sound, his argumentation cycles between threats, bad-faith arguments, and just plain old yelling.

What some people don't understand is that the Linux kernel isn't 'led' in any meaningful sense. But I suppose some projects don't need actual leadership? I once was recommended a Metallica documentary, because "It's amusing to see what emotionally stunted 40-50 year olds who have never had anyone tell them 'No' since 18 will do." That's the Linus vibe -- somehow we've limped along to here. Seriously, read the rust/rust-lang issues/RFCs. Those people sound like grownups contrasted to this.

Re: “Rust is safe” is not some kind of absolute guarantee of code safety

#116
This a naming/marketing issue.

Because "safe" in the context of a programming language is provably wrong and thus will trigger adversary reactions.

Rust is a hardened language, compared to C/C++. In the same way that Ada is hardened language, with different techniques, but the spirit is similar.

Re: “Rust is safe” is not some kind of absolute guarantee of code safety

#117
post #50

Earlier quoted context omitted.

Then it's probably not the place for you, or people with thin skin that don't want to deal with that kind of tone/communication. If they lose out on talent because of it, that's their loss. Not every project has to be perfect and all-inclusive to the entire world of developers, and I'm okay with that.

It’s crazy to think that advocating for reasonable, non-toxic people to work with receives this kind response. Inclusivity and non-hostile work environments should not be considered “perfect” and “all-inclusive”. They should be basic . The default . The lowest bar possible .

>work environments

It’s not a “work environment”. You can’t report Linus to HR. If you have a problem with him, you can fork the kernel and convince others to follow you. Then you’ll have a mailing list where you can ban Linus for his style. Good luck!

Re: “Rust is safe” is not some kind of absolute guarantee of code safety

#118

Earlier quoted context omitted.

maybe his point is that the technical meaning should use a more acurate word in his opinion?

His point seems to be the opposite, that "safety" should have a vaguer meaning in his opinion, and not the well established technical definition that the author clearly meant when he used the word.

Or, in other words, rust-safety should mean what safety means in every other context, or rust people need to come up with a different word.

Re: “Rust is safe” is not some kind of absolute guarantee of code safety

#119
post #61

> And the reality is that there are no absolute guarantees. Ever. The "Rust is safe" is not some kind of absolute guarantee of code safety. Never has been. Anybody who believes that should probably re-take their kindergarten year, and stop believing in the Easter bunny and Santa Claus. I thought that he had apologised and regretted being hostile in comments. Apparently not. Not that I have much of an issue with ranty…

> Anybody who believes that should probably re-take their kindergarten year, and stop believing in the Easter bunny and Santa Claus.

In today's news "random angry guy on the Internet tells Linus Torvalds to go back to kindergarten, because reasons"

Re: “Rust is safe” is not some kind of absolute guarantee of code safety

#120

Earlier quoted context omitted.

You need to realise that (a) that's the creator of Linux (b) see (a) above

That shouldn’t excuse him from being a reasonably decent person to work with. He gets a lot more leeway than being the creator of Linux should afford someone.

Unreasonable people build things. Reasonable people run meetings.
Post reply on HN