Rustler: Bridging Elixir and Rust with Sonny Scroggin episode artwork

EPISODE · Jun 26, 2025 · 48 MIN

Rustler: Bridging Elixir and Rust with Sonny Scroggin

from Elixir Wizards · host SmartLogic LLC

Rustler Core Team Member Sonny Scroggin joins Elixir Wizards Sundi Myint and Charles Suggs. Rustler serves as a bridge to write Native Implemented Functions (NIFs) in Rust that can be called from Elixir code. This combo leverages Rust's performance and memory safety while maintaining Elixir's fault tolerance and concurrency model, creating a powerful solution for CPU-intensive operations within Elixir applications. Sonny provides guidance on when developers should consider using NIFs versus other approaches like ports or external services and highlights the considerations needed when stepping outside Elixir's standard execution model into native code. Looking toward the future, Sonny discusses exciting developments for Rustler, including an improved asynchronous NIF interface, API modernization efforts, and better tooling. While Rust offers tremendous performance benefits for specific use cases, Sonny emphasizes that Elixir's dynamic nature and the BEAM's capabilities for distributed systems remain unmatched for many applications. Rustler simply provides another powerful tool that expands what developers can accomplish within the Elixir ecosystem. Key topics discussed in this episode: Rust as a "high-level low-level language" with memory safety NIFs (Native Implemented Functions) in the BEAM virtual machine Rustler's role simplifying Rust-Elixir integration with macros CPU-intensive operations as primary NIF use cases Beam scheduler interaction considerations with native code Dirty schedulers for longer-running NIFs in OTP 20+ Memory safety advantages of Rust for NIFs Development workflow using Mix tasks for Rustler Common pitfalls when first working with Rust Error handling improvements possible with Rustler NIFs Differences between ports, NIFs, and external services Asynchronous programming approaches in Rust versus Elixir Tokyo runtime integration for asynchronous operations Static NIFs for mobile device compatibility Upcoming CLI tooling to simplify Rustler development Rustler's API modernization efforts for better ergonomics Thread pool sharing across multiple NIFs Wasm integration possibilities for the BEAM Compile-time safety versus dynamic runtime capabilities Performance considerations when implementing NIFs Compiler-assisted memory management in Rust Automatic encoding/decoding between Rust and Elixir types The importance of proper error handling Real-world application in high-traffic authentication servers Community resources for learning Rustler Links mentioned: https://github.com/rusterlium/rustler https://github.com/rust-lang/rust https://www.angelfire.lycos.com/ https://www.webdesignmuseum.org/flash-websites https://www.php.net/ https://xmpp.org/ https://jabberd2.org/ Geocities: https://cybercultural.com/p/geocities-1995/ (fun fact: when you search Geocities on Google, the results page is in Comic Sans font.) https://bleacherreport.com/ https://hexdocs.pm/jose/readme.html https://github.com/rust-lang/rust-bindgen Erlang Ports: https://www.erlang.org/doc/system/c_port.html Erlang ETFs (External Term Format): https://www.erlang.org/doc/apps/erts/erl_ext_dist.html Elixir gRPC https://github.com/elixir-grpc/grpc gRPC (“Remote Proceduce Call”): https://grpc.io/ dirty_cpu.ex https://github.com/E-xyza/zigler/blob/main/lib/zig/nif/dirty_cpu.ex ets https://www.erlang.org/doc/apps/stdlib/ets.html Mnesia https://www.erlang.org/doc/apps/mnesia/mnesia.html VPPs (Virtual Power Plants): https://www.energy.gov/lpo/virtual-power-plants https://nixos.org/ WASM WebAssembly with Elixir: https://github.com/RoyalIcing/Orb Rust Tokio https://tokio.rs/ Getting Started: https://hexdocs.pm/rustler/0.17.0/Mix.Tasks.Rustler.New.html https://rustup.rs/Special Guest: Sonny Scroggin.

Rustler Core Team Member Sonny Scroggin joins Elixir Wizards Sundi Myint and Charles Suggs. Rustler serves as a bridge to write Native Implemented Functions (NIFs) in Rust that can be called from Elixir code. This combo leverages Rust's performance and memory safety while maintaining Elixir's fault tolerance and concurrency model, creating a powerful solution for CPU-intensive operations within Elixir applications. Sonny provides guidance on when developers should consider using NIFs versus other approaches like ports or external services and highlights the considerations needed when stepping outside Elixir's standard execution model into native code. Looking toward the future, Sonny discusses exciting developments for Rustler, including an improved asynchronous NIF interface, API modernization efforts, and better tooling. While Rust offers tremendous performance benefits for specific use cases, Sonny emphasizes that Elixir's dynamic nature and the BEAM's capabilities for distributed systems remain unmatched for many applications. Rustler simply provides another powerful tool that expands what developers can accomplish within the Elixir ecosystem. Key topics discussed in this episode: Rust as a "high-level low-level language" with memory safety NIFs (Native Implemented Functions) in the BEAM virtual machine Rustler's role simplifying Rust-Elixir integration with macros CPU-intensive operations as primary NIF use cases Beam scheduler interaction considerations with native code Dirty schedulers for longer-running NIFs in OTP 20+ Memory safety advantages of Rust for NIFs Development workflow using Mix tasks for Rustler Common pitfalls when first working with Rust Error handling improvements possible with Rustler NIFs Differences between ports, NIFs, and external services Asynchronous programming approaches in Rust versus Elixir Tokyo runtime integration for asynchronous operations Static NIFs for mobile device compatibility Upcoming CLI tooling to simplify Rustler development Rustler's API modernization efforts for better ergonomics Thread pool sharing across multiple NIFs Wasm integration possibilities for the BEAM Compile-time safety versus dynamic runtime capabilities Performance considerations when implementing NIFs Compiler-assisted memory management in Rust Automatic encoding/decoding between Rust and Elixir types The importance of proper error handling Real-world application in high-traffic authentication servers Community resources for learning Rustler Links mentioned: https://github.com/rusterlium/rustler https://github.com/rust-lang/rust https://www.angelfire.lycos.com/ https://www.webdesignmuseum.org/flash-websites https://www.php.net/ https://xmpp.org/ https://jabberd2.org/ Geocities: https://cybercultural.com/p/geocities-1995/ (fun fact: when you search Geocities on Google, the results page is in Comic Sans font.) https://bleacherreport.com/ https://hexdocs.pm/jose/readme.html https://github.com/rust-lang/rust-bindgen Erlang Ports: https://www.erlang.org/doc/system/c_port.html Erlang ETFs (External Term Format): https://www.erlang.org/doc/apps/erts/erl_ext_dist.html Elixir gRPC https://github.com/elixir-grpc/grpc gRPC (“Remote Proceduce Call”): https://grpc.io/ dirty_cpu.ex https://github.com/E-xyza/zigler/blob/main/lib/zig/nif/dirty_cpu.ex ets https://www.erlang.org/doc/apps/stdlib/ets.html Mnesia https://www.erlang.org/doc/apps/mnesia/mnesia.html VPPs (Virtual Power Plants): https://www.energy.gov/lpo/virtual-power-plants https://nixos.org/ WASM WebAssembly with Elixir: https://github.com/RoyalIcing/Orb Rust Tokio https://tokio.rs/ Getting Started: https://hexdocs.pm/rustler/0.17.0/Mix.Tasks.Rustler.New.html https://rustup.rs/Special Guest: Sonny Scroggin.

NOW PLAYING

Rustler: Bridging Elixir and Rust with Sonny Scroggin

0:00 48:58

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

REWIND: The Musician’s Podcast - How to Grow Your Music Career Amit Weiner Welcome to Rewind!An optimistic podcast that will help you in your successful Career in Music!Amit Weiner hosts musicians, composers, professors, and sound wizards, as they share their life stories and career decisions.Stay tuned, it’s gonna be epic! Behind The Irishman Netflix Go behind the scenes of Martin Scorsese’s The Irishman with this official companion podcast from Netflix. Hosted by comedian and The Irishman co-star Sebastian Maniscalco (“Crazy Joe” Gallo), this three-part series features interviews with cast and crew, including Martin Scorsese, Robert De Niro, Al Pacino, and Joe Pesci. Hear the story of Frank “The Irishman” Sheeran from the man he chose to tell it—and how Scorsese and De Niro fought for years to bring that story to the screen. Plus, learn about the brand-new technology the visual effects wizards at Industrial Light and Magic built to bring this epic tale to life. This podcast was produced by Netflix with FannieCo and Crossroad Productions. Thinking Elixir Podcast ThinkingElixir.com The Thinking Elixir podcast is a weekly show where we talk about the Elixir programming language and the community around it. We cover news and interview guests to learn more about projects and developments in the community. Whether you are already experienced with Elixir or just exploring the language, this show is created with you in mind. We discuss community news, Functional Programming, transitioning from OOP, coding conventions, and more. Guests visit the show to help challenge our assumptions, learn about new developments and grow in the process. Subscribe to join us on this journey! The Magic Academy John Fletcher, Russell Earnshaw Supporting coaching wizards! Rusty and Fletch love to hang with rockstars from the coaching world and get them sharing through some pretty cool questions

Frequently Asked Questions

How long is this episode of Elixir Wizards?

This episode is 48 minutes long.

When was this Elixir Wizards episode published?

This episode was published on June 26, 2025.

What is this episode about?

Rustler Core Team Member Sonny Scroggin joins Elixir Wizards Sundi Myint and Charles Suggs. Rustler serves as a bridge to write Native Implemented Functions (NIFs) in Rust that can be called from Elixir code. This combo leverages Rust's performance...

Is there a transcript available for this episode?

Yes, a full transcript is available for this episode. You can read the complete transcript on the episode page.

Can I download this Elixir Wizards episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!