4 ms·
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 i
by kristoff_it 2y ago
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:
https://www.youtube.com/watch?v=lDfjdGva3NE https://www.youtube.com/watch?v=lDfjdGva3NE