[Haskell-cafe] CGI module almost useless

Bjorn Bringert bringert at cs.chalmers.se
Wed Jun 15 10:04:03 EDT 2005


Graham Klyne wrote:
> At 23:06 14/06/05 +0200, Bjorn Bringert wrote:
> 
>> To the people here who are interested in the CGI module: What do you 
>> think of this interface? Could we replace the current Network.CGI with 
>> something like this?
> 
> 
> I am coming partway into this issue, and may be missing some prior art 
> (or something).
> 
> I think a an easy-to-use CGI module would be cool.  Your sample code 
> suggests a nice easy-to-use interface.  Even cooler would be if it  
> comes with support to hook into Apache's FastCGI module, or similar 
> optimized invocation from Apache.  That might inspire me to do some more 
> work on my nascent SPARQL (RDF query) implementation.

Graham, thanks for the suggestion. I went and had a look at FastCGI, and 
wrote an FFI binding to the fcgiapp C library. You can now use CGI 
programs with either CGI or FastCGI, using the same interface.

My CGI module is in a darcs repo at: 
http://www.cs.chalmers.se/~bringert/darcs/haskell-cgi/

The FastCGI module is at:
http://www.cs.chalmers.se/~bringert/darcs/haskell-fastcgi/

To use FastCGI instead of CGI, just import Network.FastCGI instead of 
Network.CGI (currently Network.NewCGI to avoid conflicts).

A simple example with CGI: 
http://www.cs.chalmers.se/~bringert/darcs/haskell-cgi/examples/printinput.hs

And with FastCGI: 
http://www.cs.chalmers.se/~bringert/darcs/haskell-fastcgi/examples/printinput.hs

/Björn


More information about the Libraries mailing list