finds.dev

rusterlium/rustler

Safe Rust bridge for creating Erlang NIF functions

View on GitHubHomepage ↗

★ 4,891RustApache-2.0updated Oct 2026

// the take

Rustler lets you write Erlang/Elixir NIFs in Rust instead of C, generating the boilerplate for encoding/decoding BEAM terms and catching Rust panics so they can't crash the VM. It's for Elixir/Erlang developers who need native-code performance (crypto, parsing, numeric work) without the usual NIF segfault risk.

Panic isolation is the real selling point — a panicking Rust function returns an error to the BEAM instead of taking the whole VM down, which is the main reason people avoid hand-written C NIFs. The derive macros for structs/enums/records cut out a lot of repetitive encode/decode code, and resource objects give you a safe way to hand a Rust-owned pointer to Erlang with the drop tied to the reference count. Mix integration (`mix rustler.new`, the compiler task) makes the Rust side feel like a normal part of an Elixir project's build rather than a bolted-on toolchain.

Dirty scheduler usage still has to be done correctly by the NIF author — Rustler doesn't stop you from blocking a normal scheduler thread with a long-running call, so you can still create BEAM-wide latency problems despite the memory safety guarantees. The NIF ABI coupling to specific OTP versions means upgrading OTP can require pulling in a new `nif_version_*` feature flag and rebuilding, which is an extra maintenance axis most pure-Elixir deps don't have. Cross-compilation and shipping precompiled binaries for multiple OS/arch targets (a common ask for libraries using this) isn't handled by Rustler itself — you're on your own for that packaging story. It's also a fairly small maintainer group for a project this many other NIFs depend on transitively, so a stalled PR or slow MSRV bump can ripple into downstream Elixir libraries.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

search the same ground:

// at a glance

Stars
4,891
Forks
249
Language
Rust
License
Apache-2.0
Last commit
23 Oct 2026

// nearby

If rustler isn't quite it.

All repos →