git404hub

what is rustler fr?

rusterlium/rustler — explained in plain English

Analysis updated 2026-06-26

4,789RustAudience · developerComplexity · 3/5LicenseSetup · moderate

tl;dr

A Rust library for writing safe native extensions (NIFs) that run inside the Erlang/Elixir VM, with crash protection and automatic type conversion between Rust and Erlang types.

vibe map

mindmap
  root((repo))
    What it does
      Safe Rust NIFs
      VM crash prevention
      Automatic type conversion
    Features
      Panic interception
      Boilerplate generation
      Serde integration
      Resource objects
    Use Cases
      High-performance Elixir code
      Safe native extensions
      Shared Rust objects
    Tech Stack
      Rust
      Elixir
      Erlang OTP
    Getting Started
      Mix dependency
      Generator command
      Minimal example

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Write a CPU-intensive function in Rust and call it from your Elixir app without risking a VM crash

VIBE 2

Add a high-performance Rust NIF to an existing Elixir project in under an hour using the mix rustler.new generator

VIBE 3

Pass complex Rust structs into Elixir with automatic type conversion using a single annotation on the struct

VIBE 4

Integrate Serde serialization to share data between Rust and Elixir without manual data conversion code

what's the stack?

RustElixirErlangOTP

how it stacks up fr

rusterlium/rustlergodot-rust/gdextgyscos/cursive
Stars4,7894,7864,792
LanguageRustRustRust
Setup difficultymoderatehardeasy
Complexity3/54/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 30min

Requires both a Rust toolchain and Elixir/OTP installed on the same machine.

Use freely for any purpose, commercial or personal, under either MIT or Apache 2.0 terms, whichever suits your project.

in plain english

Rustler is a library that lets developers write performance-critical code in Rust and call it from Erlang or Elixir programs. In Erlang's runtime, these are called NIFs, short for Native Implemented Functions. Writing NIFs directly in C is the traditional approach, but C code that crashes or behaves incorrectly can bring down the entire Erlang virtual machine with it. Rustler's main goal is to prevent that: code written through this library should not be able to crash the virtual machine, even if it encounters an unexpected error condition. The library handles the tedious parts of NIF development automatically. It generates the required boilerplate code, converts data between Erlang's internal format and Rust types, and intercepts Rust panics before they can propagate into C territory. Converting a Rust struct to something Erlang can understand takes a single annotation on the struct definition. Passing a reference to a Rust object into Erlang is also supported, with automatic cleanup when Erlang's garbage collector no longer holds a reference to it. Getting started in an Elixir project involves adding the Rustler package as a dependency and running a generator command that creates a skeleton NIF. The README shows a minimal example: a two-argument addition function in Rust becomes callable from Elixir with a few lines of code. Serde integration is available as an optional feature for projects that already use Rust's popular serialization library. Rustler supports the three most recent major OTP releases and the three most recent minor Elixir releases. It is dual-licensed under the MIT and Apache 2.0 licenses.

prompts (copy fr)

prompt 1
Generate a Rustler NIF in Rust for an Elixir project that computes Fibonacci numbers and returns the result as an integer
prompt 2
How do I convert a Rust HashMap to an Elixir map using Rustler encode and decode traits?
prompt 3
Set up a new Elixir project with a Rustler NIF using mix new and the rustler generator command, step by step
prompt 4
Handle a Rust panic safely inside a Rustler NIF so it returns an Elixir error tuple instead of crashing the BEAM VM
prompt 5
Use Rustler with Serde to pass a struct with nested fields between Rust and Elixir without writing manual term conversion

Frequently asked questions

what is rustler fr?

A Rust library for writing safe native extensions (NIFs) that run inside the Erlang/Elixir VM, with crash protection and automatic type conversion between Rust and Erlang types.

What language is rustler written in?

Mainly Rust. The stack also includes Rust, Elixir, Erlang.

What license does rustler use?

Use freely for any purpose, commercial or personal, under either MIT or Apache 2.0 terms, whichever suits your project.

How hard is rustler to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is rustler for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.