Ease of calling C code from D

Craig Dillabaugh cdillaba at cg.scs.carleton.ca
Tue Jan 28 12:55:14 PST 2014


On Tuesday, 28 January 2014 at 20:12:35 UTC, Adam D. Ruppe wrote:
> On Tuesday, 28 January 2014 at 20:10:00 UTC, Atila Neves wrote:
>> There is htod but it's Windows only.
>
> Did you see Jacob's dstep too?
>
> https://github.com/jacob-carlborg/dstep
>
> I haven't actually used it myself* but it will surely do a 
> better job than the old htod!
>
> * I'm often really lazy with my calling of C code... I 
> translate as little as possible, sometimes just using void* 
> arguments instead of structs... when possible, of course.

I used dstep to generate a D interface to FFTW (Fastest 
Fourier-Transform in the West). The header for FFTW includes a 
massive 100 line (or thereabouts) macro, that basically generates 
all the function signatures.

I ran dstep on fftw3.h and although I have only tested the result 
a little, thus far it appears to have done a great job!

Craig


More information about the Digitalmars-d mailing list