www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - erlang NIF written in D?

reply Karl <karl mailinator.com> writes:
I'm curious if it'd be possible to write erlang NIFs in D?

 From reading Interfacing to C, it seems like I'd need to generate 
a D interface file for the [not insignificant] erl_nif header, 
and then I'd be able to create a -shared file from D code and 
load it like any other shared object in Erlang?
Dec 15 2018
parent Jacob Carlborg <doob me.com> writes:
On 2018-12-16 08:43, Karl wrote:
 I'm curious if it'd be possible to write erlang NIFs in D?
 
  From reading Interfacing to C, it seems like I'd need to generate a D 
 interface file for the [not insignificant] erl_nif header, and then I'd 
 be able to create a -shared file from D code and load it like any other 
 shared object in Erlang?
Yes, should be doable. You can try DStep [1] to automatically generate bindings to the Erlang libraries (the erl_nif header). [1] http://github.com/jacob-carlborg/dstep make sure to build from master -- /Jacob Carlborg
Dec 16 2018