4 ms·
Presumably you've read enough to know that memory safety and UB are Rust's biggest selling points? If that hasn't convinced you already, I'm not sure what would
by stagger87 5y ago
Presumably you've read enough to know that memory safety and UB are Rust's biggest selling points? If that hasn't convinced you already, I'm not sure what would. Just keep using C++.
(I use C++ and I love it.)
- benreesman 5y agoI have forlorn hopes that Rust will fix build times and I'll tolerate the abusive relationship with the borrow checker if it can move the needle on that.
- firethief 5y agoFighting with the borrow checker is just a phase you have to get through, it will click. The need to write anything that can't be done without unsafety is rare (probably never unless you are writing a data structure library).
- monoideism 5y ago> UB Undefined behavior? As in, you can confine it to `unsafe`?
- tialaramex 5y agoUnsafe Code isn't allowed to have Undefined Behaviour either. What unsafe does, is it says to the compiler: "Hey, I know you're just a dumb machine, and you couldn't prove this code obeys all the rules that keep Rust safe, but I am very smart and I promise it actually is safe". You're also encouraged to explain yourself (to other humans, not the compiler, this isn't Wuffs) so that anybody else maintaining the code can see why exactly you believed this was OK. Over the years, some code which was once unsafe in Rust no longer needed an unsafe block, because Rust's compiler got smarter, "Oh, I see why this is OK". But if your unsafe code has Undefined Behaviour that's actually a serious bug, it's not what unsafe is for at all.
- monoideism 5y agoThat's what I thought, or at least suspected, so not sure why "UB" was listed as a Rust selling point.
- tialaramex 5y agoI am not the poster in question, but I assume that they meant Rust avoids Undefined Behaviour and this is indeed a notable selling point, compared to low-level languages.