zlacker

[return to "“Rust is safe” is not some kind of absolute guarantee of code safety"]
1. Pragma+b8[view] [source] 2022-10-02 15:12:48
>>rvz+(OP)
I’ve been using Rust for a while, and I’m so, so tired of hearing this argument.

Yes, we know. We get it. Rust is not an absolute guarantee of safety and doesn’t protect us from all the bugs. This is obvious and well-known to anyone actually using Rust.

At this point, the argument feels like some sort of ideological debate happening outside the realm of actually getting work done. It feels like any time someone says that Rust defends against certain types of safety errors, someone feels obligated to pop out of the background and remind everyone that it doesn’t protect against every code safety issue.

◧◩
2. TillE+Oa[view] [source] 2022-10-02 15:29:13
>>Pragma+b8
It's really common to see people say meaningless stuff like "Rust is a safe language" which is either deeply confused or deeply misleading.

Rust provides certain guarantees of memory safety, which is great, but it's important to understand exactly what that means and not to oversell it.

◧◩◪
3. pornel+4d[view] [source] 2022-10-02 15:41:51
>>TillE+Oa
It's an unproductive pedantry to expect every mention of the generalisation to be followed by a full disclaimer about exceptions and edge cases.

People say "it's raining" without having to add "except under roofs".

◧◩◪◨
4. lifthr+dh[view] [source] 2022-10-02 16:05:41
>>pornel+4d
I think, if the wording was exactly "Rust is safe" it is indeed too vague as there are many notions of safety, and annoyingly enough people do say this. But "Rust provides memory safety" is clear enough and doesn't need further quantification.
◧◩◪◨⬒
5. pornel+Xi[view] [source] 2022-10-02 16:15:02
>>lifthr+dh
Official Rust materials are careful not to overpromise and to be clear on the extent of what is guaranteed and what isn't.

The safety is always with an asterisk. Rust provides memory safety — provided that unsafe blocks, FFI, and other code running in the same process, and the OS itself, and the hardware doesn't misbehave.

But if you accept that Python and Java can be called safe languages then Rust can be too. The other ones also have unsafe escape hatches and depend on their underlying implementations to be correct to uphold safety for their safe side.

[go to top]