4 ms·
So there are a few ways to do interop with non-BEAM languages. Ports are the typical one for simpler things. You start an external command and talk to it via s
by lawik 6y ago
So there are a few ways to do interop with non-BEAM languages.
Ports are the typical one for simpler things. You start an external command and talk to it via stdin/stdout.
NIFs are potentially much faster and are traditionally in C. But they carry the risk of crashing the VM. Rustler+Rust removes most, likely not all, but most of the risks for screwing up and killing the VM.
So NIFs are usually not recommended simply because the resilience and reliability of the BEAM VM relies on a bunch of cool strategies inside the VM and NIFs side-step all of that. The Rust ones should be far less dangerous.