Re:Simple, Fast and Safe Manual Memory Management [pdf]
by falcolas on Thursday September 28, 2017 @10:03AM
(#15357159)
The truth of the matter is, so long as you're dealing with non-deterministic system states or unsafe regions of code, you will always be prone to failing at runtime. Incorrect programmer assumptions, out of memory errors (which are becoming more common with memory-constrained containers), parsing implemented using a ok-or-panic idiom, attempting to read a file you have no permissions to access, having to read from volatile memory regions, cosmic rays flipping memory bits... all can cause even Rust programs to fail at runtime.
Runtime failure is a reality of every program, best to account for it.
Re:Simple, Fast and Safe Manual Memory Management [pdf]
by oconnor663 on Thursday September 28, 2017 @10:53AM
(#15357510)
> all can cause even Rust programs to fail at runtime
For sure, a safe Rust program can fail in a dozen different ways. My favorite is just creating an unsigned 0 and trying to subtract 1 from it -- in debug mode that'll panic and probably crash the whole program. But unless you touch the `unsafe` keyword, it should be impossible to fail in a way that causes undefined behavior. That's the big difference.
Edit: You're right, I missed the point :| :| :|
For a critical application I vastly prefer to get these annoying compilation errors rather than the illusion of productivity now and then getting runtime exceptions in a shipped product.
Be happy to fail as soon as possible.