I don't think this is right. The process will crash, and the Supervision strategy you are using will determine what happens from there. This is what the BEAM is all about. The thing with NIFs is that they can crash the entire VM if they error.
Erlang's (Elixirs) error management approach is actually "Let it crash"
This is based on the acknowledgment that if you have a large number of longer running processes at some point something will crash anyway, so you may quite as well be good at managing crashes ;-)
How so? The whole point of unwinding is to gracefully clear up on panics, how did it peak for you?
It's also not like there is much of a choice here. Unwinding across FFI boundaries (e.g. out of the NIF call) is undefined behaviour, so the only other option is aborting on panics.
kristoff_it|1 year ago
I wrote this recently about Go, but it equally applies to any Rust application that tries to recover from a panic.
https://kristoff.it/blog/go-exceptions-unconvinced/
ellroy|1 year ago
MarcusE1W|1 year ago
This is based on the acknowledgment that if you have a large number of longer running processes at some point something will crash anyway, so you may quite as well be good at managing crashes ;-)
https://dev.to/adolfont/the-let-it-crash-error-handling-stra...
throwawaymaths|1 year ago
filmor|1 year ago
It's also not like there is much of a choice here. Unwinding across FFI boundaries (e.g. out of the NIF call) is undefined behaviour, so the only other option is aborting on panics.