ElixirConf 2021 - Isaac Yonemoto - Zig (heart) Elixir
ElixirConf2 HN recommenders · recommended in 2 months, 2021–2025
talk · advanced · 2021–2025 on HN
Isaac Yonemoto's ElixirConf 2021 talk on Zigler, a library for writing Elixir NIFs in Zig. He looks at its internals and how it bridges the two languages while keeping the NIFs well behaved on the BEAM.
HN threads on Zig and Elixir link it as the creator's explanation of how Zig NIFs can behave nicely inside the BEAM.
Up next
3 mo on HNWhat's a Memory Allocator Anyway? - Benjamin Feng
Zig SHOWTIME
3 HN recommender · 2020–2021
18 mo on HNRuby Conf 12 - Y Not- Adventures in Functional Programming by Jim Weirich
Confreaks
17 HN recommender · 2013–2026
14 mo on HNThe Soul of Erlang and Elixir • Sasa Juric • GOTO 2019
GOTO Conferences
16 HN recommender · 2019–2024
14 mo on HN"Simple Made Easy" - Rich Hickey (2011)
Strange Loop Conference
14 HN recommender · 2022–2026
13 mo on HN"Making Impossible States Impossible" by Richard Feldman
elm-conf
9 HN recommender · 2017–2026
12 mo on HNWilliam Byrd on "The Most Beautiful Program Ever Written" [PWL NYC]
PapersWeLove
11 HN recommender · 2017–2026
11 mo on HNThe Value of Values with Rich Hickey
InfoQ
10 HN recommender · 2014–2023
12 mo on HNWhy Isn't Functional Programming the Norm? – Richard Feldman
Metosin
12 HN recommender · 2019–2025
11 mo on HNMaybe Not - Rich Hickey
ClojureTV
14 HN recommender · 2018–2025
11 mo on HNSolving Problems the Clojure Way - Rafal Dittwald
Clojure/north
10 HN recommender · 2019–2025
10 mo on HNLecture 1A: Overview and Introduction to Lisp
MIT OpenCourseWare
10 HN recommender · 2019–2026
10 mo on HNConway's Game Of Life in APL
Dyalog
11 HN recommender · 2010–2024
6 comments from Hacker News
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: ▶ this video
Really fascinating to see Zig being used to make Elixir cross platform! Exciting stuff. Here's a direct link to the ElixirConf talk: ▶ this video
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: ▶ 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?
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! ▶ this video
Links for anyone curious. > Syntax highlighting here can work correctly, actually. Highlighting shown here in the 2021 ElixirConf talk posted elsewhere in the comments: ▶ 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
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: ▶ this video Yielding is async and threaded is sync)