-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWAI-GW.tex
25 lines (18 loc) · 2.2 KB
/
WAI-GW.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
% WAI-GW.tex
\begin{hcarentry}{WAI}
\label{wai}
\report{Michael Snoyman}%05/13
\participants{Greg Weber}
\status{stable}
\makeheader
The Web Application Interface (WAI) is an interface between Haskell web
applications and Haskell web servers. By targeting the WAI, a web framework or web application gets access to multiple deployment platforms. Platforms in use include CGI, the Warp web server, and desktop webkit.
WAI has mostly been stable since the last HCAR, with the exception of a newly added field to represent the request body length. This avoids repeatedly doing a costly integer parse, and correctly handling the case of chunked bodies at the type level. WAI has also been updated to allow the newest version of the conduit~\cref{conduit} package.
WAI is also a platform for re-using code between web applications and web frameworks through WAI middleware and WAI applications. WAI middleware can inspect and transform a request, for example by automatically gzipping a response or logging a request. The Yesod~\cref{yesod} web framework provides the ability to embed arbitrary WAI applications as subsites, making them a part of a larger web application.
By targeting WAI, every web framework can share WAI code instead of wasting effort re-implementing the same functionality. There are also some new web frameworks that take a completely different approach to web development that use WAI, such as webwire (FRP) and dingo (GUI). The Scotty web framework also continues to be developed, and provides a lighter-weight alternative to Yesod. Other frameworks- whether existing or newcomers- are welcome to take advantage of the existing WAI architecture to focus on the more innovative features of web development.
WAI applications can send a response themselves. For example, wai-app-static is used by Yesod to serve static files. However, one does not need to use a web framework, but can simply build a web application using the WAI interface alone. The Hoogle %\cref{hoogle}
web service targets WAI directly.
The WAI standard has proven itself capable for different users and there are no outstanding plans for changes or improvements.
\FurtherReading
\url{http://www.yesodweb.com/book/wai}
\end{hcarentry}