3 ms·
Someone much more insightful than me pointed out that most of the safety advantages of Rust are really a cultural phenomenon, rather than a strictly technical o
by dmm 3y ago
Someone much more insightful than me pointed out that most of the safety advantages of Rust are really a cultural phenomenon, rather than a strictly technical one. You could write unsafe unsafe Rust that derefs invalid pointers all day but when building systems and libraries with Rust, people value safety and Rust enables that as a priority.
- pjmlp 3y agoYes, that is kind of true. It is also what attracted me into C++ coming from Turbo Pascal and Turbo Basic, back in the early 1990's. Although C++ culture could be much better towards safety, it is definitely better than whatever WG14 is doing, or C has brought into the picture for the last 50 years. Also anyone that just copy pastes C like code into C++, is the kind of developer that will be using unsafe{} all over the place, on the languages that have them.
- imtringued 3y agoTelling people to stop using unsafe is much easier than telling people to not have undefined behaviour. C developers like telling themselves that only people with bounded rationality make security critical mistakes. All the skilled C developers have ascended beyond the mortal realm and would never let themselves be chained up with crutches for the weak like affine types or overflow/bounds checking.
- worik 3y ago> a cultural phenomenon, rather than a strictly technical one. You could write unsafe unsafe Rust that derefs invalid pointers all day Yes you could. But I do not think " cultural" is the right term for not putting all your code in an `unsafe` block
- Ygg2 3y ago> Someone much more insightful than me pointed out that most of the safety advantages of Rust are really a cultural phenomenon, rather than a strictly technical one It's not. It's a safety phenomenon. See Java, C# etc. Java doesn't have huge focus on it, but managed to get it right.