Episode Details

Back to Episodes
Zig Meets the BEAM: Garrison Hinson-Hasty & Isaac Yonemoto on Safer Native Code

Zig Meets the BEAM: Garrison Hinson-Hasty & Isaac Yonemoto on Safer Native Code

Season 1 Episode 20 Published 1 week ago
Description

Everyone who's ever written a C NIF for the BEAM knows the story. You have a bottleneck, you reach for native code, it works - until one day it doesn't, and instead of a process crashing, the whole node goes down. A segfault in a NIF takes the entire BEAM with it, bypassing every fault-tolerance guarantee OTP was designed to provide.

This episode asks a simple question: do we have to accept that? The answer, increasingly, is no.

Allen Wyma and Francesco Cesarini sit down with Garrison Hinson-Hasty, author of Systems Programming with Zig, and Isaac Yonemoto, creator of Zigler - the library that lets you write Zig directly inside Elixir and Erlang modules, with automatic marshalling, scheduler-aware execution modes, and memory tracking that's visible to the BEAM itself.

This is part of the podcast's ongoing "right tool for the job" series, following earlier episodes on Rust and native code.

Topics include:

  • what Zig is and why it exists - C's simplicity and zero-cost abstractions, without C's footguns

  • how Zig compares to both C and Rust: where it wins, where it loses, and why they're solving different problems

  • why Zig's allocator model is unusually well-suited for BEAM integration - and what it means that Zigler uses the BEAM's own allocator by default, making native memory visible to Erlang's VM

  • how Zigler works: write Zig in a sigil inside your Elixir module, and the marshalling between BEAM terms and native types is handled automatically at function call boundaries

  • the four execution modes Zigler gives you - normal, dirty CPU, dirty IO, spawned thread - and how to pick one without changing a single line of your Zig code

  • the honest answer to the question every BEAM developer wants to ask: can a Zigler NIF still crash the whole node? (Yes. Isaac explains exactly when and why, and what Zig's spatial memory safety actually buys you)

  • why Zig has no hidden control flow and no lexical macros, and why that matters when you're debugging something at the boundary between two runtimes

  • where Zig's async story currently stands, and what that means for Zigler's roadmap

  • Isaac's unusual professional position: CEO of a pharma startup who is also writing the software stack for his own lab in Zig and Elixir

Recorded June 9, 2026.

Resources mentioned:

  • Systems Programming with Zig by Garrison Hinson-Hasty

  • Zigler on Hex and GitHub

  • Zigler docs

Listen Now

Love PodBriefly?

If you like Podbriefly.com, please consider donating to support the ongoing development.

Support Us