Apache "mod_d" needs C to instantiate D interpreter?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Nov 8 19:21:25 PST 2010


On 11/8/10 4:37 PM, JFD wrote:
> Yes, you're right.  One should implement Apache module in D.
>
> One thing is that Apache module entry point expects a "C" function.  I've figure
> that that one could just add extern(C) in front of D function to be callable from
> C, so that was easy.  Also, Apache expects .so shared library, and one could build
> it roughly like this:
>
> Let DMD build a .a library:
> dmd -fPIC -lib libhello.d
>
> Then convert it to shared library:
> gcc -shared -Wl,-soname,libhello.so.0 -o libhello.so.0.0 libhello.a
>
> Could DMD build .so shared library directly (did I miss something)?
>
> Then it's all D from there on.  Cool!
>
> Thank you.

People at Facebook told me that the adoption of D inside the company 
might be helped if they could simply write <?d ... ?> to insert D code 
into a page. I'm not sure how difficult such a plugin would be to 
implement. Also, D code should be able to call PHP code (which is a bit 
less difficult than it seems because we use HPHP, a PHP to C++ translator).

Andrei


More information about the Digitalmars-d mailing list