
Lately I have started to think about how I would like to implement a web application framework in Haskell. To keep my thoughts well defined, I have decided to write some documents. My ideas are heavily based on my experience with Python WSGI, and a Python WSGI framework I'm implementing (wsgix). Note that there is already another attempt to define an Haskell Gateway interface, and it may also have the same name! However I'm not trying to write a formal specification. The core of my idea is in the Haskell Web Application Framework, I just need a gateway interface as a building block. I apologize for my not very good experience at writing in english and Haskell. Also note that the document is in a very rough state. I'm announcing it here, to receive feedback, just to make sure that what I would like to do is possible/convenient to do in Haskell. The documents (only the first one - HSGI - available at the moment) are available here: http://mperillo.ath.cx/haskell/ Thanks and regards Manlio Perillo

Hi Manlio, Have you looked at http://www.haskell.org/haskellwiki/WebApplicationInterface ? If you did is there something in that proposal that you think should be changed or is not clear? There is currently a lot of interest in writing web frameworks for Haskell and it would be great if the frameworks support a common interface like Python's WSGI and Ruby's Rack interface and all use the same frontends like Hyena and modules for Apache, Nginx etc. Felix

Felix Martini ha scritto:
Hi Manlio,
Have you looked at http://www.haskell.org/haskellwiki/WebApplicationInterface ?
If you remember, I posted a few messages in the thread where WAI was announced. There is a separate channel where we can discuss in detail? Or should I just use this thread?
If you did is there something in that proposal that you think should be changed or is not clear?
Here are the problems: 1) supported HTTP methods are fixed, since you use a custom data type 2) no support for other possible CGI variables (or simply custom variables: I use the environ dictionary to store application configuration, and I think it is a great thing). I think that we should simply have a dictionary Map ByteString ByteString 3) No support for optimized file serving, like with WSGI file_wrapper 4) No support for keeping "complex" state (like database connection) in the environ. I have read some examples with CGI package, where a custom monad transformer is used. I'm not sure if this solution is flexible and "scalable". 5) I can't find documentation about the type of the response. It is rather clear that it is (ByteString, [(ByteString, ByteString)], Enumerator) but this should be documented somewhere. There are also few typos: * Chapter 2: "A standardized interface is of no use of no..." should be "A standardized interface is of no use if no..." * Chapter 4.2 "However, if the the amount..." should be "However, if the amount..." As a last note: I have some doubts about the name, since gateway is not in it ;-). Regards Manlio Perillo

Felix Martini ha scritto:
Hi Manlio,
Have you looked at http://www.haskell.org/haskellwiki/WebApplicationInterface ? If you did is there something in that proposal that you think should be changed or is not clear? There is currently a lot of interest in writing web frameworks for Haskell and it would be great if the frameworks support a common interface like Python's WSGI and Ruby's Rack interface and all use the same frontends like Hyena and modules for Apache, Nginx etc.
Another typo at chapter 4.2 (the end): "The consumed likely wants..." should be "The consumer likely wants..." Another problem I have not discussed in previous reply is with the use of the custom Enumerator. There is nothing wrong in using it (it is the best choice, IMHO), however there is *little* support for enumerators in Haskell base packages, and little examples about how to use it. It is not a "know" pattern in the Haskell community. So, it may be the right choices, but it may be a bit premature, IMHO.
Felix
Manlio
participants (2)
-
Felix Martini
-
Manlio Perillo