Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. rustler

rustler

Apache-2.0Rustrustler-0.37.3

A safe Rust library for creating Erlang NIFs that prevents crashes in the BEAM VM.

Visit WebsiteGitHubGitHub
4.8k stars238 forks0 contributors

What is rustler?

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.

Target Audience

Erlang and Elixir developers who need to write performance-critical native extensions or integrate existing Rust libraries into their BEAM-based applications.

Value Proposition

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.

Overview

Safe Rust bridge for creating Erlang NIF functions

Use Cases

Best For

  • Writing safe, high-performance native extensions (NIFs) for Erlang or Elixir applications.
  • Integrating existing Rust libraries or algorithms into the BEAM ecosystem without risking VM crashes.
  • Creating resource objects to safely pass references to Rust structs into Erlang/Elixir code with automatic cleanup.
  • Simplifying the encoding and decoding of Rust values into Erlang terms with minimal boilerplate.
  • Extending Elixir applications with Rust code, as the library currently favors Elixir integration.
  • Building NIFs that require compatibility with specific NIF versions (e.g., 2.15, 2.16, or 2.17) via feature flags.

Not Ideal For

  • Projects requiring simple, quick extensions without Rust's compile-time overhead or NIF complexity
  • Teams exclusively using pure Erlang without Elixir, as the library currently favors Elixir integration
  • Applications where maintaining a separate Rust codebase adds undue operational complexity compared to optimized BEAM-native solutions
  • Real-time systems sensitive to NIF scheduling delays, as native code execution can still impact BEAM scheduler behavior

Pros & Cons

Pros

BEAM Safety Guarantee

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.

Effortless Interoperability

Simplifies encoding and decoding of Rust values into Erlang terms with easy function calls, reducing boilerplate as demonstrated in the minimal 'add' NIF example.

Attribute-Based Type Composition

Allows making Rust structs encodable and decodable to Erlang/Elixir with a single attribute, streamlining data handling as per the type composition feature.

Automatic Resource Cleanup

Safely passes references to Rust structs into Erlang code as resource objects, with automatic cleanup when no longer referenced, preventing memory leaks.

Cons

Elixir-Centric Bias

The README states the library favors Elixir over Erlang, which may result in less polished support or documentation for pure Erlang projects.

Version Management Complexity

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.

Dual Ecosystem Overhead

Integrating Rust necessitates managing both Rust and BEAM toolchains, increasing initial configuration and ongoing maintenance compared to single-language solutions.

Frequently Asked Questions

Quick Stats

Stars4,784
Forks238
Contributors0
Open Issues36
Last commit1 month ago
CreatedSince 2015

Tags

#elixir#nif#type-safety#ffi#interoperability#native-extensions#beam-vm#erlang#binding#rust#performance

Built With

C
Cargo
s
serde
R
Rust

Links & Resources

Website

Included in

Rust56.6k
Auto-fetched 1 day ago

Related Projects

RustPythonRustPython

A Python Interpreter written in Rust

Stars22,027
Forks1,428
Last commit1 day ago
PyO3PyO3

Rust bindings for the Python interpreter

Stars15,606
Forks961
Last commit7 days ago
wasm-bindgenwasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript

Stars8,967
Forks1,208
Last commit2 days ago
NeonNeon

Rust bindings for writing safe and fast native Node.js modules.

Stars8,407
Forks286
Last commit4 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub