[erlang-questions] best practice for calling C from Erlang
Mon Dec 13 22:16:33 CET 2010
# Attila Rajmund Nohl 2010-12-13:
> 2010/12/13, Timo Lindemann <>:
> > Hi,
> > I have made good experiences with the new NIF interface, having hacked an
> > interface to libtidy in one afternoon, and I didn't even know what NIFs were
> > until that morning, so I can definitely say that this is a very easy
> > interface for crossing the boundary quickly. Automatic generation of an
> > interface I don't know much about, I just wanted to chime in to say that
> > NIFs are easy to do, and the wrapper is so thin you might not need to
> > autogenerate it, there's very little boilerplate left to autogenerate.
> Surely it's not much for one function. But for 125 functions it worth
> considering generating code...
BTW In complex cases, 'clang -fsyntax-only -Xclang -ast-print-xml -o a.xml a.c'
comes in handy -- gives you straightforward XML description[*] of C APIs...
[*] I mean straightforward after erlsom:simple_form/1 of course.
More information about the erlang-questions