[erlang-questions] Any tools available to generate code for Erlang Ports?

Tim Watson <>
Tue Jan 18 21:49:57 CET 2011

On 18 January 2011 13:54, Dave Challis <> wrote:
> I'm just curious - are there any tools or code generators out there for
> creating Erlang Ports to interface with C code?
> There are a bunch of old C libraries I'd like to be able to use from within
> Erlang, and it seems pretty time consuming to code interfaces to them from
> scratch.

There's the Erlang Driver Toolkit
(http://www.snookles.com/erlang/edtk/) which is pretty good but
documentation is a bit sparse. It looks pretty solid. Another one is
DryvErl but I've not looked closely at that one. I came across another
tool on github recently - https://github.com/tonyrog/eapi. This is
completely undocumented apart from some example code, but looks very
interesting. Finally, there was a guy on the list some time ago
mentioning that he'd written some generic C/C++ stuff for generating
driver code, but I've been unable to fish out the link to his post.
You might want to try searching github, as there are probably a few
others out there too.

I'd also suggest looking into NIFs if you're library calls are likely
to be short lived - as long as you do need complex state in the driver
and can live with blocking semantics, they're a significantly easier
options and not too hard to code yourself.



More information about the erlang-questions mailing list