Published 2007-07-13 18:25:37

I've been slowly ticking away adding features to the gtk javascript bindings, in doing so, I'm adding extra libraries - Mysql works quite well, and Seeing the recent post on about fastcgi4d, I wondered if I could run dmdscript from fastcgi.

To enable a web version of dmdscript with my bindings, I had to do quite a bit of re-organization, enabling it to be built with random libraries added in and exclude the Gtk stuff. Core to this was to move all the registration code into the directories that hold the binding code. Each binding directory now contains 3 files, binding***.d, binding***type.d and register***.d. Which manage the dynamic loading of .so (or .dll if windows actually works). and the registering of all the javascript objects and methods.

For fastcgi, I had a look at the code described on the blog post, but was very reluctant to use it, as it
  • required tango, which is not a current requirement, and I'm a little concerned about using.
  • required knowlege of templates, which are still a bit of a black art. and I've only used very sparingly when absolutly every other alternative has been ruled out.
So after considerable digging through the code and trying to make head or tail of the code on, I finally found the python fastcgi code, which ported easily to D.

The core files libraries that are helpers in dealing with fastcgi are here.

They need the loader.d and paths.d file from here
to be usable.

and the current, non-threaded simple responder is here

So for hello world example, this simple piece of code dumps all the server variables and says hello world.

println("hellow world from javascript");
Next job is to look at how GET/POST data is passed around and how to escape data on output. among a list of 100 ideas for how it could all work.
Mentioned By: : april (90 referals) : december (68 referals) : dmdscript (18 referals) : dmd fastcgi (10 referals) : Planet PHP (8 referals) : dmdscript with fastcgi - Alan Knowles-- 专业PHP社区|论坛|PHP5|教程|源码|下载|框架|手册|类库|PEAR - Powered by (7 referals) : DMDScript Tango (6 referals) : fastcgi javascript (6 referals) : javascript fastcgi (5 referals) : FastCGI4D (4 referals) : fastcgi Dmd (3 referals) : gtkds (3 referals) : dnews: Web Developer RSS News Feeds [Headlines from Planet PHP: Daily News] - loadaverageZero (2 referals) : Planet DebianHK | Debian HK (2 referals) : D fastcgi bindings (2 referals) : fastcgi4d windows (2 referals) : gtk javascript bindings (2 referals) : dmd tango - Google Search (1 referals) : akbkhome dmdscript (1 referals) : amoxicillin (1 referals)


Alan, did you think about writing php-extensions in D?

Somehow, I think that can be more comfortable than writing them in C ;)
#0 - Alexey Zakhlestin ( Link) on 2007-07-13 20:06:15 Delete Comment

Add Your Comment