3 ms·
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 w
by mijoharas 2y 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 https://github.com/rusterlium/rustler
- junon 2y agoI have no evidence of this but they may be liberally using catch_unwind: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html https://doc.rust-lang.org/std/panic/fn.catch_unwind.html