

Rustler: Bridging Elixir and Rust with Sonny Scroggin
Jun 26, 2025
Sonny Scroggin, a member of the Rustler Core Team and an expert in high-performance applications, joins Sundi Myint and Charles Suggs for an engaging discussion. They explore the seamless integration of Rust and Elixir, focusing on Native Implemented Functions (NIFs) for CPU-intensive tasks. Sonny shares insights on when to use NIFs versus other approaches, emphasizing Rust's memory safety. Exciting future developments for Rustler, including asynchronous NIF interfaces, are highlighted, alongside the enduring strengths of Elixir's dynamic model.
AI Snips
Chapters
Transcript
Episode notes
Rust as High-Level Low-Level Language
- Rust manages memory safety at compile time, preventing common bugs like use-after-free errors.
- It offers low-level control with high-level safety, making it unique among system languages like C and C++.
JWT NIF at Bleacher Report
- Sonny recalled building a NIF for JWT signing at Bleacher Report to handle spiky traffic efficiently.
- The Rust NIF significantly improved JWT signing speed, reducing CPU saturation during high demand.
When to Choose NIFs
- Reach for Rustler NIFs only when needing to optimize CPU-intensive operations.
- Prefer ports or external services when performance needs are lower or when isolation from the BEAM is advantageous.