Skip to content
vic

wltsmrz/nimler

Erlang/Elixir NIFs in Nim

wltsmrz/nimler.json
{
"createdAt": "2019-10-09T08:16:24Z",
"defaultBranch": "develop",
"description": "Erlang/Elixir NIFs in Nim",
"fullName": "wltsmrz/nimler",
"homepage": "https://smrz.dev/nimler",
"language": "Nim",
"name": "nimler",
"pushedAt": "2021-11-06T04:30:14Z",
"stargazersCount": 104,
"topics": [
"elixir",
"erlang",
"nif",
"nim"
],
"updatedAt": "2025-10-18T11:31:58Z",
"url": "https://github.com/wltsmrz/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.

TargetStatus
x86_64-linux
arm64-linux
Terminal window
$ nimble install nimler

Nimler is documented at smrz.dev/nimler.

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 ]