# Rustler

> Write Erlang and Elixir NIFs in safe Rust

Source: https://talira.ai/catalog/rustler-w0cgm3kr
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / language bindings](https://talira.ai/categories/developer-tools/language-bindings), [languages / elixir](https://talira.ai/categories/languages/elixir), [languages / rust](https://talira.ai/categories/languages/rust)
- Licence: MIT OR Apache-2.0[^1][^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [rusterlium](https://talira.ai/orgs/rusterlium.md)

Rustler is a library for writing native implemented functions (NIFs) for the Erlang VM in safe [Rust](https://talira.ai/catalog/rust-mf51vs5t.md), so native code can't crash the BEAM: it generates the boilerplate for talking to the VM, encodes and decodes Erlang terms, and catches Rust panics before they unwind into C. A single attribute makes a Rust struct encodable to [Elixir](https://talira.ai/catalog/elixir-edq5dfnt.md) or [Erlang](https://talira.ai/catalog/erlang-xsdkv450.md) terms, and resource objects pass Rust structs to BEAM code and drop them when they're no longer referenced. It works with Erlang and Elixir, favouring Elixir, whose `rustler` package on Hex adds a Mix compiler and `mix rustler.new`. It's dual-licensed under MIT or Apache 2.0.

## Links

- GitHub: https://github.com/rusterlium/rustler
- Docs: https://docs.rs/rustler/latest/rustler

## Problems it solves

- speed up a hot path in my Elixir app by writing it in Rust
- call a Rust library from Elixir without risking a VM crash
- write an Erlang NIF without hand-writing C

## Features

- write Erlang VM NIFs in safe Rust
- encodes and decodes Erlang terms
- catches Rust panics before they reach the VM
- derive attribute makes Rust structs encodable
- resource objects for passing Rust structs to BEAM code
- Mix compiler and mix rustler.new generator for Elixir

## Trust

Overall: 0.57 out of 1.
Signals: maintenance 0.72, adoption 0.74, momentum 0.47, community 0.79, backing 0.30, extensibility 0.00.

- last commit 15 days ago
- 18 commits in the last 90 days
- latest release rustler-0.39.0 49 days ago
- 4.9k GitHub stars
- 94 contributors
- backed by rusterlium

## Related

- Works with [Elixir](https://talira.ai/catalog/elixir-edq5dfnt.md)
- Works with [Erlang](https://talira.ai/catalog/erlang-xsdkv450.md)

## Alternatives

- [PyO3](https://talira.ai/catalog/pyo3-kv62pfvk.md): Rust bindings for Python: write Python extensions in Rust or embed Python
- [Rustler Precompiled](https://talira.ai/catalog/rustler-precompiled-p39w82b1.md): Ships precompiled Rustler NIFs so Elixir users don't need the Rust toolchain
- [Unifex](https://talira.ai/catalog/unifex-n7fdj13n.md): Generates the interface between native C code and Elixir
- [flutter_rust_bridge](https://talira.ai/catalog/flutter-rust-bridge-5cp1d45d.md): Call Rust code from Flutter and Dart, with the glue code generated for you
- [bindgen](https://talira.ai/catalog/bindgen-8awz7b66.md): Generates Rust FFI bindings to C and some C++ libraries from their headers

## Sources

[^1]: https://github.com/rusterlium/rustler/blob/master/README.md (checked 26 Nov 2026)
[^2]: https://github.com/rusterlium/rustler/blob/master/rustler/Cargo.toml (checked 26 Nov 2026)
