Apache "mod_d" needs C to instantiate D interpreter?

Nick Sabalausky a at a.a
Tue Nov 9 11:20:37 PST 2010


"Jacob Carlborg" <doob at me.com> wrote in message 
news:ibbjmv$e8p$1 at digitalmars.com...
> On 2010-11-09 04:21, Andrei Alexandrescu wrote:
>> 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
>
> Can't DMD already compile D code embedded in HTML: 
> http://www.digitalmars.com/d/2.0/html.html ?
>

I seem to remember hearing that was being depricated. And it was never 
anything like what Andrei's describing. IIRC, all it did was completely 
ignore all the HTML stuff (ie, treat it like comments). It didn't send it to 
Stdout or anything.




More information about the Digitalmars-d mailing list