4 ms·
unsafe blocks play no role in any kind of security aside from memory safety. You are communicating with extreme disingenuity.
by tatterdemalion 10y ago
unsafe blocks play no role in any kind of security aside from memory safety. You are communicating with extreme disingenuity.
- braveo 10y agoHey, you're right, getting memory usage correct doesn't affect safety at all. good day.
- dbaupp 10y agoReading an array out of bounds is definitely unlikely to be correct/be a security vulnerability. Memory safety is absolutely a prerequisite for any other sort of safety one might want.
- braveo 10y agoWe agree on that, my point is that C++ does it via libraries, Rust does it by hiding unsafe blocks behind interfaces (aka libraries). Time will tell which approach is ultimately superior (if either one of them is actually better), but until the it isn't clear that the Rust approach is statistically better than the C++ approach. Ultimately the advantage Rust has is the ability to possibly provide better 3rd party tooling that will enable developers to make the right decisions more often than C++ does. Consider a tool that runs on code checkin that spits out a report of all sites where code that manipulates state that could affect an unsafe block was changed/written so that developers could then have a very focused peer review of the code to ensure the safe code doesn't put the state in such a spot that it causes problems. I think in this way Rust may eventually be shown to be better than C++, but then again, maybe not.
- burntsushi 10y ago> We agree on that, my point is that C++ does it via libraries, Rust does it by hiding unsafe blocks behind interfaces (aka libraries). That's a false equivalency and completely ignores the fact that C++ is one giant `unsafe` block. > but until the it isn't clear that the Rust approach is statistically better than the C++ approach Could you please explain what kind of evidence would convince you?
- braveo 10y ago> That's a false equivalency and completely ignores the fact that C++ is one giant `unsafe` block. This is exactly what I meant when I said rust people miss the forest for the trees. > Could you please explain what kind of evidence would convince you? you quoted me explaining what I would need.