Live data from Hacker News

No-Panic Rust: A Nice Technique for Systems Programming

blog.reverberate.org

1–10 of 143 posts

Re: No-Panic Rust: A Nice Technique for Systems Programming

#4
post #3

This seems..absurd for a programming language with goals like Rust. Why isn't this a compiler option? Just set -nopanics and the compiler errors and flags anything which is pulling in a panic at the very least?

Yeah, I'm fairly sure that there is such a flag/toplevel attribute... and if there isn't, there should be one.

It also feels like most of the pains on avoiding panics centers around allocations which, though a bit unfortunate, makes sense; it was an intentional design choice to make allocations panic instead of return Results, because most users of the language would probably crash on allocation fails anyways and it would introduce a lot of clutter. There was some effort some while ago on having better fallible allocations, but I'm not sure what happened over there.

Re: No-Panic Rust: A Nice Technique for Systems Programming

#8
post #3

This seems..absurd for a programming language with goals like Rust. Why isn't this a compiler option? Just set -nopanics and the compiler errors and flags anything which is pulling in a panic at the very least?

https://doc.rust-lang.org/book/ch09-01-unrecoverable-errors-...

``` [profile.release] panic = 'abort' ```

Re: No-Panic Rust: A Nice Technique for Systems Programming

#9
This seems to obviate a lot of Rust's advantages (like a good std library). I wonder what it would take to write a nopanic-std library?

Panics really seem bad for composability. And relying on the optimzer here seems like a fragile approach.

(And how is there no -nopanic compiler flag?)

Post reply on HN