[Haskell-cafe] Haskell Web Framework

Rick R rick.richardson at gmail.com
Tue Jan 27 15:54:46 EST 2009


On Tue, Jan 27, 2009 at 3:05 PM, Michaeljohn Clement <mj at mjclement.com>wrote:

> John A. De Goes wrote:
>
...
> There is very little wrong with ECMAScript if people would only
> learn it properly and play to its strengths instead of trying to
> turn it into things it is not.
>
> Treating ECMAScript as a compiler target language will be a win
> eventually, I expect, but not by compiling from Haskell.  Haskell
> could certainly play a role, e.g. as an implementation language
> for ES-to-ES or DSL-to-ES compiler writers.
>
> ...
> --
> Michaeljohn Clement
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


Javascript itself is such a versatile language I don't think it needs to be
hidden by a DSL, but, as you mentioned an ES-to-ES wrapper, with the
exception that the framework could auto generate a few helper functions on
the client side.

I think the optimal approach is to create a sort of generator of "client"
applications.
These applications will use XHTML for graphical structure and Javascript for
logic.

The haskell framework would streamline the creation of dynamic HTML and
offer a fast and simple means of specifying an RPC interface from the client
to the server. It would also make sense to leverage an existing set of
libraries for this purpose. JQuery RPC is fantastic (as is the rest of
JQuery) and, IMO, it provides enough abstraction to make Javascript
tolerable for any type of programmer.

Using the Client/Server paradigm, one could gain additional performance
benefits from templates.  Since all of their dynamic state is set an runtime
via javascript, they can all be precompiled into XHTML and JS. To avoid the
initial request for values after the page load, an appendix could be sent
from the server with the XHTML file that automatically sets all of the
dynamic values.

I have been slowly building a proof of concept of these ideas using HAML as
the template engine and JQuery.RPC as the communication mechanism. It's not
intended to be a full framework, but a client generator that could make JSON
RPC requests to any RESTful interface (sorry for the buzzwords)
I'll yell when I have something to show.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090127/10b3481d/attachment.htm


More information about the Haskell-Cafe mailing list