[Haskell-cafe] ANNOUNCE: wai-0.0.0 (Web Application Interface)

Michael Snoyman michael at snoyman.com
Thu Mar 4 17:56:56 EST 2010


Hello all,

I'd like to announce the first release of the Web Application Interface
package[1]. The WAI is a common protocol between web server backends and web
applications, allowing application writers to target a single interface and
have their code run on multiple server types.

There are two previous implementations of the same idea: the Network.Wai
module as implemented in the Hyena package, and Hack. Some distinguishing
characteristics of the wai package include:

* Unlike Hack, this does not rely upon lazy I/O for passing request and
response bodies within constrained memory.
* Unlike Hyena, the request body is passed via a "Source" instead of
Enumerator, so that it can easily be converted to a lazy bytestring for
those who wish.
* Unlike both, it attempts to achieve more type safety by have explicit
types of request headers, response headers, HTTP version and status code.
* It also removes any variables which are not universal to all web server
backends. For example, scriptName has been removed, since it has no meaning
for standalone servers.

This package also contains separate modules for conversions to and from
Sources and Enumerators.

I am also simultaneously releasing two other packages: web-encodings
0.2.4[2] includes a new function, parseRequestBody, which directly parses a
request body in a WAI request. It handles both URL-encoded and multipart
data, and can store file contents in a file instead of memory. This should
allow dealing with large file submits in a memory-efficient manner. You can
also receive the file contents as a lazy bytestring.

Finally, wai-extra 0.0.0 [3] is a collection of middleware and backends I
use regularly in web application development. On the middleware side, there
are five modules, including GZIP encoding and storing session data in an
encrypted cookie (ClientSession). On the backend side, it includes CGI and
SimpleServer. The latter is especially useful for testing web applications,
though some people have reported using it in a production environment. All
of the code is directly ported from previous packages I had written against
Hack, so they are fairly well tested.

As far as stability, I don't expect the interface to change too drastically
in the future. I am happy to hear any suggestions people have for moving
forward, but expect future versions to be mostly backwards compatible with
this release. Also, future versions will respect the Package Versioning
Policy[4].

Thanks to everyone who contributed their input.

Michael

[1] http://hackage.haskell.org/package/wai
[2] http://hackage.haskell.org/package/web-encodings
[3] http://hackage.haskell.org/package/wai-extra
[4] http://www.haskell.org/haskellwiki/Package_versioning_policy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100304/f6411985/attachment.html


More information about the Haskell-Cafe mailing list