Can D code be linked as part of C programs? (plug-ins in D?)

kll kl at mailinator.com
Mon Mar 2 04:57:34 PST 2009


Jarrett Billingsley Wrote:

> > e.g. can I write Apache module (dynamically linked .so file) using D?
> 
> Sure.
> 
> > I wonder if that's a matter of sneaking in D's runtime, starting GC, etc., or is it not possible at all?
> 
> That's precisely what you do.  If you compile the D piece of your
> program as a lib, including its runtime, you should be able to link C
> code to it.  You'll have to call the runtime startup/teardown
> functions yourself, but it should work.  I'm pretty sure people have
> made Apache modules in D before.

Sorry, I couldn't find information how to do this (I'm a D noob). D site has only info how to link C with D, not D with C. 

It seems that DLL's a close to what I need (and I've found Apache module that uses them), but I'm not interested in Windows platform at all, I'm looking for Linux and OS X solution.

Where should I look for this?



More information about the Digitalmars-d mailing list