5 ms·
The Rust definition of 'unsafe' is very far from the everyday meaning. Yeah you can mentally substitute 'rustc_cannot_vouch_for' but why can't Rust use a word
by emmelaich 6y ago
The Rust definition of 'unsafe' is very far from the everyday meaning.
Yeah you can mentally substitute 'rustc_cannot_vouch_for' but why can't Rust use a word closer in meaning to that in the first place?
We tend to misuse everyday meanings I think. I reminded of
1. the msdos warning that 'this program has used an illegal instruction and will be shut down'
2. That DNS names with underscore are 'illegal'. This one caused an amusing kerfuffle at one company I worked at.
3. That certain crypto algos are 'broken'
- powersnail 6y agoI'm reminded of "my phone has 64g of memory". It makes sense to a lay person, that memory would mean storage. This is inevitable. We either invent new words, or we use existing words from the natural language. The latter will always lead to confusion at some point, because the domain-specific concept doesn't exist in the rest of the world. To represent such a concept, a word would need to deviate from its everyday usage. I think Rust's "unsafe" is an okay choice; the "vouching" is a feature about memory safety after all.
- kbenson 6y ago> The Rust definition of 'unsafe' is very far from the everyday meaning. "safe" is entirely relative in it's everyday meaning. To one person skydiving is safe, to another it is extremely unsafe. When you're a child your parent will tell you what is safe or not, but what your parent considers safe is based on their personal definition of safety. The rust language will tell you if what you've done is safe based on its very well defined criteria for what that is, and won't let you proceed with something that doesn't match that criteria unless you vouch for it yourself. unsafe makes just as much sense here as any other word, it only seems a wrong fit when you look at it from a context it's not meant to be used in.
- emmelaich 6y agoI'd suggest that 'unsafe' is quite far away from the opposite meaning of 'safe' in everyday language.
- tracker1 6y agoOn a very similar note, a line in Mythbusters' opening that always amused me, "We're professionals, and that keeps us safe." No, it doesn't, it only means that someone is willing to pay you to do it. I think the use of "unsafe" is exactly what is a common case. That is declaring, "I know what I am doing," and that for most people do do this may be a bad idea.