19 ms·
In what way is Rust suitable as a systems language if we don't have a picture of what unsafe code is or is not allowed? At least in C there is a consensus abou
by theseoafs 10y ago
In what way is Rust suitable as a systems language if we don't have a picture of what unsafe code is or is not allowed?
At least in C there is a consensus about what works and what doesn't -- i.e. pointer aliasing is technically undefined behavior but the modern compilers let you get away with it. In Rust there doesn't even seem to be a consensus about how the compiler should work.
- DasIch 10y agoC technically has consensus on what is and what isn't undefined behavior. You don't have sufficient tooling around that though, which means that while that consensus exists, it's hard to take advantage of it. Additionally you don't have consensus at all on what should and shouldn't be undefined behavior. In practice that consenus has little to no meaningful impact. In Rust on the other hand you have people that deeply care about problems like this, demonstrated not just by what they say but what they do. I think you can therefore have a lot of confidence in them not just reaching consenus on this issue but creating meaningful solutions based on that consensus.
- bsder 10y ago> i.e. pointer aliasing is technically undefined behavior but the modern compilers let you get away with it. In Rust there doesn't even seem to be a consensus about how the compiler should work. Careful, there has been much gnashing of teeth over the fact that higher optimization levels of gcc do very surprising things with "undefined" code.
- yarper 10y agoC is also 44 years old, according to wikipedia.
- tatterdemalion 10y ago> pointer aliasing is technically undefined behavior but the modern compilers let you get away with it This is exactly the kind of situation Rust wants to avoid.
- theseoafs 10y agoOkay, and that's fine if Rust doesn't want to be used for making kernels, programming language runtimes, etc. You know, systems language stuff.
- deleted 10y ago[deleted]
- tatterdemalion 10y agoThis is ill-informed and dogmatic bravado. It has no content. Please don't make comments like this in the future, they are an invariably negative contribution to the conversation. You do not understand the post you are commenting on, which assumed a level of understanding of Rust that made it a poor fit for this venue.
- Manishearth 10y agoThere are already kernels written on Rust.
- Manishearth 10y agoWe do have a good-enough picture right now with which you can write code that works and will continue to work; we just don't have an exact picture (where you can knowingly cut corners and things still work). Niko's post is mostly about where these corners should be.