Server-Side magazine interview, touches on D

Adam D. Ruppe destructionator at gmail.com
Sun Jan 29 21:45:31 PST 2012


On Monday, 30 January 2012 at 05:17:21 UTC, Andrei Alexandrescu 
wrote:
> The difficult part is integrating with Apache.

Eh, it's not so bad. Make a .htaccess file:

.htaccess:
===
Action dhp-script /cgi-bin/dhp
AddHandler dhp-script .dhp
===

Drop in your files.

hello.dhp
===
<?d cgi.write("Hello, world!"); ?>
===
NOTE: that is cgi.write, not writefln. This version uses
my cgi library so you have all those awesomesauce functions.


And in your cgi-bin folder, build dhp out of this
file:

http://arsdnet.net/dcode/dhp_cgi.d

And drop my cgi.d into your /tmp directory.
http://arsdnet.net/dcode/cgi.d

End result?

http://arsdnet.net/dhp/hello.dhp

works.


Of course, you'll see this is slow because it
runs the compiler every time. If it used rdmd instead
of dmd though, we'd get cache and it'd probably work
pretty decently. (My computer doesn't have rdmd set up
currently though.)


More information about the Digitalmars-d-announce mailing list