[Haskell-cafe] Functional Reactive Web Application Framework?

Petr Pudlak deb at pudlak.name
Wed May 13 15:22:27 EDT 2009


On Wed, May 13, 2009 at 06:46:45AM -0400, Arjun Guha wrote:
> > Flapjax is javascript so possibly there could be a way to integrate it
> > into Haskell using HJavascript?  Maybe it could even be integrated
> > into Happstack?
> 
> The Flapjax compiler is written in Haskell, so that might help.
> 
> I assume you want to write FRP in a Haskell-embedded DSL and generate
> FRP'd JavaScript.  If you wish to use Flapjax as a supporting library
> I'd be glad to help.
> 
> Arjun

Actually, I wanted to use Flapjax as the base for client-side programming.
I didn't think about combining Flapjax with HJavaScript, this is quite a good
idea.

However, this would is just one part of what I'd like to have. No doubt many
things can be done on the client, but more serious work or database
operations must be done on the server anyway. Ideally, I'd like to spare a
programmer from:
 * Working with HTML (unless explicitly desired); Instead, I'd prefer to
   compose the pages from components, either predefined or user-defined. This
   could be done for example using DSL in Haskell. The components could be both
   lightweight (almost HTML), or heavyweight like "menu", "toolbar" etc.
 * Transferring data between a server/client. Especially using FRP, this might
   be done very neatly I suppose. An event stream or a behavior could be
   transferred seamlessly by the framework from the client to the server and
   vice versa.  The programmer would only see behaviors on either side.

I've been working with the ZK framework <http://zkoss.org/> lately, and it has
many nice features. For example, composing pages from high-level components,
the possibility to separate the layout of the pages form the controlling
code, or sparing a programmer from working with HTML and HTTP requests -
everything is done just by manipulating component objects and handling
events. However, it's not functional at all. I believe FRP would be much better
solution than classical event handling. And secondly, it's in Java, which is
nothing bad (actually my code is in Scala), just it's not Haskell.

Happsstack looks good, though I didn't have time to study it.

Thanks for the links for OCAML JavaScript FRP, it looks iteresting too.

    Petr


More information about the Haskell-Cafe mailing list