Dynamic Compilation

Keean Schupke k.schupke@imperial.ac.uk
Thu, 12 Jun 2003 12:23:09 +0100

Whilst I Agree with you about Apache being widely useful, most websites 
fall into the category database backend, dynamic content in the middle 
and HTTP infront. Apache is a waste of disc space and memory, if all you 
want is Haskell Servlets (Think Java Servlets and Tomcat - a large 
number of major projects are done on tomcat which is a server written in 
Java, completely stand alone from Apache). Further to this HTTP is quite 
a simple protocol, and its implementation in Haskell quite easy - there 
is really no need for a complete implementation of the standard - you 
only really need put and get...

When using servlets there is no need for CGI or FastCGI, the server is 
written in Haskell, the Servlets are
written in Haskell, you use the ghci-linker to load up the pages - 
although for high demand services it is better
to compile the pages into the server for better speed. A record is used 
to parse the request to the servlet.

The setup we use - with real paying customers - is an implementation of 
HTTP in haskell - Authentication is
provided by a plug-in, and like most sites uses on-page login/password 
boxes, the server provides session management,
so the Servlet simply has to deal with page generation and parsing 
user-feedback. A database backend using ODBC
means we can change database without major code rewrites. Everything is 
in Haskell (apart from the DB) and this setup
will do 90% of the things you would ever want a dynamic web site to 
do... (The other 10% does not justify code bloat in
the server - for those 10% use different tools)

    Keean Schupke...

Peter Simons wrote:

>Keean  writes:
> > 	http://losser.st-lab.cs.uu.nl/mod_haskell/
> > But, think of the advantages of a type-safe web-server, utilising GHC's
> > light weight threads...
>Well, yes, but the problem is that web server today must provide tons
>of things to be suitable for production use. Authentication, CGI, even
>FastCGI come to my mind, etc., etc. I don't think something like
>Apache can be re-built from scratch very easily, so it's good that
>Haskell support for it is available.
>Glasgow-haskell-users mailing list