Elixir Wizards

Zigler: Zig NIFs for Elixir with Isaac Yonemoto

May 29, 2025
Isaac Yonemoto, creator of the Zigler library and CEO of Videla Labs, discusses his venture into combining Zig's performance with Elixir's capabilities using Native Implemented Functions (NIFs). He explains Zigler's auto-generated Elixir-to-Zig bridge and its three execution modes: normal, dirty, and threaded. Isaac shares insights on his biotech startup that leverages Elixir for bioinformatics and highlights the benefits of Zig in hardware acceleration for large language models. He also touches on the importance of fault tolerance in low-level coding practices.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Zig's Unique Metaprogramming

  • Zig offers a metaprogramming system that runs code at compile time, blending advantages of macros and AST manipulation.
  • This system is restrictive but powerful, allowing type-safe, compile-time code execution unlike traditional macros.
INSIGHT

Zig Async and Zigler NIF Modes

  • Zig temporarily removed async support, which affects yielding NIFs in Zigler.
  • Despite this, Zigler continues to support normal, dirty, and threaded NIF modes, switchable with one config setting.
ADVICE

Use Zigler's Auto-generated Bridges

  • Zigler auto-generates the Elixir-to-Zig bridge handling the complex boxing/unboxing and type checking for you.
  • This dramatically reduces errors and provides clear error messages when wrong types are passed into NIF functions.
Get the Snipd Podcast app to discover more snips from this episode
Get the app