Skip to content
0:00 / 0:00

#zigler#nif#beam

ElixirConf 2021 - Isaac Yonemoto - Zig (heart) Elixir

ElixirConf

13K subscribers • 27 videos on Hallway

YouTube
  • Recommended by 2 people: 2 on Hacker News.
  • Presented by Isaac Yonemoto, creator of Zigler

Advanced. Deep dive for people who know the field.

3.9K views5 years ago2 recommendations

Programming languagesSystems programmingZigElixir and ErlangConcurrency and parallelism

Isaac Yonemoto explains how Zigler allows developers to write low-level Zig NIFs that behave well within the Elixir BEAM virtual machine.

Zigler is a library that allows you to easily write NIFs (low-level code) for Elixir that are good citizens of the BEAM. This talk will take a peek at some of the internals to see how Zigler creates a bridge between the two languages.

Why it's here

2 people recommend this

What people say. Recommended for its explanation of how to write well-behaved Elixir NIFs in Zig and manage BEAM concurrency.

brightballon Hacker News • Recommends

On “Zig monthly, October 2021: Games, gamedev, Elixir, tools and more”

Really fascinating to see Zig being used to make Elixir cross platform! Exciting stuff. Here's a direct link to the ElixirConf talk: link to this video

kristoff_iton Hacker News • Recommends

On “Zigler: Zig NIFs in Elixir”

There's a series of things that a NIF must do to be a good citizen. Not crashing is a big one, but also not starving the VM by never yielding (in case the NIF is long-running) is important, plus a few secondary things like using the BEAM allocator so that tooling that monitors memory consumption can see resources consumed by the NIF. The creator of Zigler has a talk from ElixirConf 2021 on how he made Zig NIFs behave nicely: link to this video

throwawaymathson Hacker News • Mentions

On “The two types of C programmers (a provocative thesis)”

Got it. Thank you for your perspective. I can appreciate that comptime is tricky. Indeed, async zig is hard and annoying (but you're wrong about the function coloring... Here is someone's project where they call an async function alternately from a sync or async context with zero lines of code: link to this video Yielding is async and threaded is sync)

h0l0cubeon Hacker News • Mentions

On “Zigler: Zig NIFs in Elixir”

Links for anyone curious. > Syntax highlighting here can work correctly, actually. Highlighting shown here in the 2021 ElixirConf talk posted elsewhere in the comments: link to this video > I'm not sure why it's not better documented in Zigler Here's the docs for it (though buried in the 'advanced' section) link

dnauticson Hacker News • Mentions

On “Zig breaking change – Initial Writergate”

something that I don't understand about the actual API: I maintain the zigler library, and one thing that was useful about the old async "colored-but-not-really" functions was that they implicitly tolerate having internal suspend points (detail: link to this video ) -- I'm not sure if having IO be a passed parameter will still let me do that? Can users build their own functions with yield points? And will you be able to jump out of the frame of a function and give control back to the executor, to let it resume later?

dnauticson Hacker News • Mentions

On “Resizable structs in Zig”

RE: Elixir I have a feeling that the zig's i/o strategy will enable me to bring back the zig-async-dependent yielding nifs in zigler. I'm really hopeful io interface will have a yield() function, that would be even better! link to this video