[web-devel] Re: ANN: Salvia-1.0.0
Michael Snoyman
michael at snoyman.com
Mon Mar 22 14:51:56 EDT 2010
On Mon, Mar 22, 2010 at 7:59 AM, Sebastiaan Visser <sfvisser at cs.uu.nl>wrote:
> > Am I right, that it uses its own protocol, i.e. no WAI?
>
> To answer your question: yes, Salvia uses its own protocol. Athough the
> term `protocol' might mean different things when looked at from different
> perspectives.
>
> How do I put this delicately? I do not think WAI is the way to go.
>
> On the Hackage page of WAI I read: "Provides a common protocol for
> communication between web aplications and web servers." This means that WAI
> is a proposed standardized interface intended to sit between server and a
> web application. There several reasons why I don't like the idea of a
> standardized interface between the application server and the web
> application.
>
> First of all, no one will ever agree on this type of interface. Not on the
> level of abstraction, not on the actual naming of the datatypes, not on the
> amount of documentation, not on the placement of the parenthesis. I, for
> example, don't like WAI at all: I do not want be forced to use enumerators
> for the output, ByteStrings for the input, only 10 predefined response
> codes, etc.
>
> [..]
What I do like to see though, is something like the Ruby Rack interface,
> which calls itself a "a Ruby Webserver Interface". This is an interface
> between the actual OS/network and the application server, not an interface
> between an application server and the web application. Call it WSI not WAI,
> this subtle difference actually means a lot.
>
> This WSI would just give me file handle/socket and possible a pre-parsed
> HTTP message, but that is all. A Rack-like interface would allow me to run
> my Salvia web applications on any backend, like CGI, or in mod_haskell, in
> the blazingly fast iteratee based Hyena or behind an Apache proxy. But
> still, the web application is written against Salvia (or the framework you
> like most) and can piggy bag on all the neat features it supplies.
>
> Salvia itself has such a WSI, although I'm pretty sure this one is to
> abstract and high level to be a true candidate for any form of
> standardization.
>
> I'm not really sure what distinction you're trying to make here. Hack is
(as I understand it) a direct port of Rack to Haskell. (I've never used
Rack, so correct me if I'm wrong.) WAI is at the same level of abstraction
as Hack, so it seems strange to say Rack == Good, Hack/WAI == Bad.
I'm also not certain what you mean by Rack being an interface between the OS
and the webserver. I would think of POSIX as being an interface between the
OS and the webserver.
And yes, no one will ever agree on the right interface; but WAI (I believe)
is general enough to work with most web programming approaches without
sacrificing performance. Want to produce responses as lazy bytestrings? Go
ahead, there's a built-in converter from a lazy bytestring to an enumerator.
Finally, I think it's not that case that WAI degrades Happstack or Salvia to
mere backends; instead, it *splits* them into backends and frontends.
Happstack is experimenting with a WAI port right now, and if it works, the
result will be a Happstack WAI-compliant server and a Happstack
WAI-compliant application framework*.
Michael
* I know it's not exactly true to classify Happstack as that since they are
really splitting it into a set of libraries, but it's a close approximation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/web-devel/attachments/20100322/a65e0a5b/attachment.html
More information about the web-devel
mailing list