Skip to content

wltsmrz/nimler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

56c08c2 · Nov 11, 2020
Nov 7, 2020
Aug 30, 2020
Sep 5, 2020
Aug 29, 2020
Sep 5, 2020
Apr 5, 2020
Oct 28, 2019
Nov 11, 2020
Sep 5, 2020
Sep 5, 2020
Sep 6, 2020
Apr 16, 2020

Repository files navigation

nimler

Nimler is a library for authoring Erlang and Elixir NIFs in the Nim programming language. It has mostly complete bindings for the Erlang NIF API and some accessories for making writing NIFs easier, including idiomatic functions for converting between Erlang terms and Nim types, and simplifications for using resource objects.

Mostly, Nimler is a minimal, zero-dependency wrapper for Erlang NIF API.

Build status

Target Status
x86_64-linux
arm64-linux
$ nimble install nimler

Documentation

Nimler is documented at smrz.dev/nimler.

Sample

import nimler

func add(env: ptr ErlNifEnv, a: int, b: int): (ErlAtom, int) {.xnif.} =
  (AtomOk, a + b)
  
func sub(env: ptr ErlNifEnv, a: int, b: int): (ErlAtom, int) {.xnif.} =
  (AtomOk, a - b)

exportNifs "Elixir.NifMath", [ add, sub ]