2 ms·
> LLVM's optimizer considers undefined behavior a license to kill. Of course, that only matters in unsafe code, We’re not quite there yet with defining rigorou
by chrismorgan 10y ago
> LLVM's optimizer considers undefined behavior a license to kill. Of course, that only matters in unsafe code,
We’re not quite there yet with defining rigorous semantics for unsafe code (there are still a couple of undefined things at present), but Rust does intend to rigorously define all behaviour. So this is a quibble which is being dealt with.
(Note that there’s still the odd rustc bug involving LLVM doing something it shouldn’t, but those are just bugs. See https://github.com/rust-lang/rust/issues?q=is%3Aopen%20label%3AI-wrong%20label%3AA-LLVM https://github.com/rust-lang/rust/issues?q=is%3Aopen%20label... for a couple.)
> but you need unsafe code for anything complicated.
… what? Somewhere deep down in your dependencies, maybe, but for most things you really don’t need unsafe code.
----
Most of the rest of the issues are either Rust immaturity (compiler is slow, &c.) or tradeoffs that the language has made (String vs. &str). There are definitely some legitimate criticisms in it.
- hyperpape 10y ago>> but you need unsafe code for anything complicated. > … what? Somewhere deep down in your dependencies, maybe, but for most things you really don’t need unsafe code. If anyone has an account or feels like creating one, that line really should be changed to "unsafe code can't always be avoided" or "fundamental types like Vector are implemented with unsafe" or something similar.
- all2well 10y ago>fundamental types like Vector are implemented with unsafe That's kind of the point, though: Vec provides a safe interface over behavior that would otherwise be unsafe. You could as easily complain that C is fundamentally implemented in machine code without any type safety.
- hyperpape 10y agoI agree that it's not a huge problem. But it does communicate accurately where unsafe appears, unlike the existing text.