mix barnacle.new (zig_barnacle v0.1.0)

Copy Markdown View Source

Generates a standalone Zig project ready to build a BEAM NIF using cement.

Usage

# From the Elixir project root (creates native/<name>/)
mix barnacle.new hasher

# Create inside the current directory (e.g. after `cd native`)
mix barnacle.new hasher --here

# Custom options
mix barnacle.new hasher --dir native --module MyApp.Hasher --barnacle-path ../../barnacle --elixir-stub

Options

  • --here - Create ./<name> in the current working directory instead of native/<name>
  • --dir PATH - Parent directory to create <name> inside
  • --module NAME - Elixir module name for ErlNifEntry.name (e.g. MyApp.Hasher)
  • --barnacle-path PATH - Path to the barnacle Zig dependency in build.zig.zon
  • --otp N - Default OTP version in build.zig (defaults to current BEAM OTP release)
  • --elixir-stub - Also create lib/<app>/<name>.ex using Barnacle.Nif