A safe Rust library for creating Erlang NIFs that prevents crashes in the BEAM VM.
Rustler is a library for writing Erlang Native Implemented Functions (NIFs) in safe Rust. It enables developers to extend Erlang and Elixir applications with high-performance Rust code while ensuring the stability of the BEAM virtual machine. The library handles the complex boilerplate of Erlang interoperability, making it accessible to integrate Rust's performance benefits into Erlang/Elixir ecosystems.
Erlang and Elixir developers who need to write performance-critical native extensions or integrate existing Rust libraries into their BEAM-based applications.
Developers choose Rustler because it prioritizes safety by preventing Rust code from crashing the BEAM VM, and it simplifies interoperability by handling encoding/decoding boilerplate and providing easy attribute-based type composition.
Safe Rust bridge for creating Erlang NIF functions
Prevents Rust panics from crashing the BEAM VM by catching them before they unwind into C, a core feature highlighted in the README's safety section.
Simplifies encoding and decoding of Rust values into Erlang terms with easy function calls, reducing boilerplate as demonstrated in the minimal 'add' NIF example.
Allows making Rust structs encodable and decodable to Erlang/Elixir with a single attribute, streamlining data handling as per the type composition feature.
Safely passes references to Rust structs into Erlang code as resource objects, with automatic cleanup when no longer referenced, preventing memory leaks.
The README states the library favors Elixir over Erlang, which may result in less polished support or documentation for pure Erlang projects.
Requires careful handling of NIF version features (e.g., 2.15, 2.16) via Cargo flags and compatibility with specific OTP/Elixir versions, adding setup overhead.
Integrating Rust necessitates managing both Rust and BEAM toolchains, increasing initial configuration and ongoing maintenance compared to single-language solutions.
A Python Interpreter written in Rust
Rust bindings for the Python interpreter
Facilitating high-level interactions between Wasm modules and JavaScript
Rust bindings for writing safe and fast native Node.js modules.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.