See
Inline NIF support for C
Simply use See in your module
defmodule Math do
use See
~C"""
int add(int a, int b) {
return a + b;
}
double scale(double x, double factor) {
return x * factor;
}
"""
end
iex> Math.add(1, 2)
3
iex> Math.scale(3.0, 2.5)
7.5
Motivation
I wanted to have something like Rustler or Zigler but for C.
Disclaimer
This is NOT production-ready, it's simply a fun side-project.