|
unsafe {} doesn't mean the code within is not safe; rather, it means that the memory safety of the block is promised by the programmer, instead of the compiler. The programmer might be wrong, of course. If you are trying to do something that you know is fine, but the compiler isn't smart enough to prove, that's exactly when you should be using unsafe {}. But it's probably wiser to implement it in such a way that the compiler doesn't need to trust you, wherever possible.
|
# ¿ Jul 31, 2015 16:48 |
|
|
# ¿ Apr 29, 2024 21:43 |
|
sarehu posted:Seriously? Online forums have had "rules" that are about "be nice to people, don't be a dick," since forever, for example, and they read a lot differently when they aren't full of dog-whistles and designed to reinforce a certain political thesis about how the world is. Online forums, noted bastions of professionalism and decency.
|
# ¿ Feb 8, 2016 00:19 |
|
Rust's memory management is based on the observation that types aren't the only things you can enforce at compile-time. The work of ensuring memory consistency is still being done; it's just that a large part of that work was put into the compiler, and the part that remains for the end-user to do takes the form of appeasing the compiler.
|
# ¿ Jun 9, 2016 00:36 |
|
sarehu posted:Or the end user could understand what's going on. You should be able to "see the allocations" -- they're as visible as they are in C++. Well, yes. I only mean that the fact that having a machine checking your work makes it easier.
|
# ¿ Jun 9, 2016 04:03 |
|
Stinky_Pete posted:Hello, I started learning Rust because this game/graphics engine called Amethyst uses it. I've been going through Rust by Example and I'm totally in love, but I was just wondering, who is responsible for Cargo staying up? Is it Mozilla? Bet you could email them to find out.
|
# ¿ May 19, 2020 07:52 |
|
|
# ¿ Apr 29, 2024 21:43 |
|
ADTs are a good enough feature that I'd be willing to put up with a vastly worse language than Rust in order to be able to use them.
|
# ¿ May 26, 2023 17:04 |