簡體   English   中英

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

[英]What is the workflow for implementing ERTS NIFs in Zig?

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

對於用 Rust 編寫的NIF ,是否有與Rustler相媲美的東西?

所述齊格勒包可用於: https://github.com/ityonemo/ziglerhttps://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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM