在 Zig 中实施 ERTS NIF 的工作流程是什么?

What is the workflow for implementing ERTS NIFs in Zig?

在 Zig 中实施 ERTS NIFs 的工作流程是什么?

对于用 Rust 编写的 NIF,是否有与 Rustler 相当的东西?

可以使用Zigler包:https://github.com/ityonemo/zigler, https://hex.pm/packages/zigler

defmodule ExampleZig do
  use Zig
  ~Z"""
  /// nif: example_fun/2
  fn example_fun(value1: f64, value2: f64) bool {
    return value1 > value2;
  }
  """
end

test "example nifs" do
  assert ExampleZig.example_fun(0.8, -0.8)
  refute ExampleZig.example_fun(0.1, 0.4)
end