Hacker News new | ask | show | jobs
by mijoharas 605 days ago
I believe that by using rustler[0] to build the bindings that shouldn't be possible. (at the very least that's stated in the readme.)

> Safety : The code you write in a Rust NIF should never be able to crash the BEAM.

I tried to find some documentation stating how it works but couldn't. I think they use a dirty scheduler, and catch panics at the boundaries or something? wasn't able to find a clear reference.

[0] https://github.com/rusterlium/rustler

1 comments

I have no evidence of this but they may be liberally using catch_unwind: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html