[Haskell-cafe] web servers

Graham Klyne GK at ninebynine.org
Wed Apr 12 06:52:55 EDT 2006

I'm interested, but I don't have the time to look right now (or in the next
couple of months, as far as I can see).

What would really interest me is a system that can provide the functionality of
the Python packages I currently use (TurboGears [1], of which the web
server/controller component is CherryPy [2]).  There's also some interesting
recent CherryPy-related discussion about web dispatching that I think could
translate very well to Haskell [3][4].


I'd also be interested in a system that handled overlapped asynchronous requests
in a fashion not dissimilar to Twisted [5].  I've very recently been playing
with Twisted as a way to deal with large numbers of overlapping lightweight
requests without having large numbers of active threads.  Twisted requires one
to string together asynchronous callbacks to assemble a process that completes
over time.  It seems to me that the sequencing of asynchronous operations is
very much like threading computations in a monad, and that the higher-order
functions on monads could also be used for composition of asynchronous
operations.  I just implemented a "sequence" function for Twisted operations
whose implementation started to feel very like "foldr".

This can't be new, and I'm wondering if there is any interesting work out there
on using monads for multiple asynchronous I/O operations.  (And, much as I'd
love to use Haskell for this, is there work that would translate cleanly to Python?)


[1] http://www.turbogears.com/

[2] http://www.cherrypy.org/

[3] http://pythonpaste.org/do-it-yourself-framework.html
    (cf. descriptions of object publishing)

[4] The above link was posted in this discussion thread:

[5] http://twistedmatrix.com/

Daniel McAllansmith wrote:
> Following is a message I sent yesterday, sans attachment.  Looks like the code 
> was too bloated to get through under the list size limit.
> As I say in the original message , I'm keen for any feedback.  So let me know 
> if anyone wants the actual code (20 KB, compressed) to have a look through.
> Cheerio
> Daniel
> On Sunday 09 April 2006 06:24, Tim Newsham wrote:
>> I found a copy of Simon Marlow's HWS on haskell.org's cvs 
>> server.  I know there's a newer plugin version, but I cant find a working
>> link to the actual code.
> There's this link: http://www.mdstud.chalmers.se/~md9ms/hws-wp/
>>From memory I think there may have been a more recent version at 
> scannedinavian.org (possibly only accessible with darcs?), but still a couple 
> of years with no apparent activity.
>> Besides HWS, what other web servers exist?  Does anyone actually use a
>> haskell based web server in practice?  Which web server is considered the
>> most mature?  stable?  fastest?
>> I'm trying to decided if I should sink some time into HWS or if I should
>> use another server.
> Several months ago I had a bit of play-time available which I spent on writing 
> a HTTP server in Haskell.
> The goal was a HTTP 1.1 compliant server that could be embedded in a Haskell 
> app, be reconfigured on the fly and have different request handlers 
> added/removed.
> I did have a quick look at HWS before I started but I seem to recall it was 
> pretty basic (in terms of the amount of the HTTP spec. implemented).
> In any event, I started from scratch.  It's certainly not finished, and it's 
> the very first thing I wrote with Haskell so it's a bit of a dogs breakfast, 
> but it might be of interest.
> There's lots that needs doing but it should just be a case of writing a 
> request handler to get it doing _something_ useful.
> It's always been my intention to get back to it, clean it up a bit/lot and 
> release it under a more liberal licence (currently 'all rights reserved'), 
> but have had little time available.
> Eventually I hope to actually use it in anger.
> If anyone is interested in using it, contributing to it, or picking over it 
> for use in an existing project, I'll try and find somewhere stable to host it 
> and change the licence.
> Feel free to ask questions on what it does/doesn't do.  You'll probably need 
> to, given the documentation ;-)
> Regardless of it's utility, any criticism or advice on the code would be 
> appreciated.
> Daniel
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

Graham Klyne
For email:

More information about the Haskell-Cafe mailing list