*Flapjax*
Paper Title: Flapjax: A Programming Language for Ajax Applications
Author(s): Leo A. Meyerovich, Arjun Guha, Jacob Baskin, Gregory H.
Cooper, Michael Greenberg, Aleks Broomfields, Shiriram Krishnamurthi
Date: OOPSLA �09. October 25-29, 2009.
Novel Idea: Flapjax is �language� built atop Javascript and HTML
designed to guarantee consistency in the face of numerous external and
internal events. Instead of forcing developers to reason about callbacks
and their effects on global state, the Flapjax developers have provided
JavaScript developers with so-called reactive semantics though the
addition of behaviors and event streams. Changes to behavior variables
and new events on event streams automatically propagate through the
system and recalculate any dependent values akin to a spreadsheet.
Execution occurs using a mostly-acyclical directed graph; cycles must be
broken by explicit or implicit delays. Flapjax can be used either a
language (where a compiler compiles Flapjax code into Javascript,
allowing users to get the full syntactic benefits of Flapjax), or as a
JavaScript library. The authors argue that consistency is so important
that a language authors should offer it as a basic primitive.
Main Result(s): The paper presents a case for why a new paradigm is
needed, presents the Flapjax language by a series of examples, and
discusses a number of instances where Flapjax has been used to create
�real� websites at Brown and elsewhere. Some lessons learned are
exposed, but no substantial evaluation is given.
Impact: This type of project usually gets judged by the size of its user
community�I noticed a website (
flapjax-lang.org), but I�m not sure how
prevalent usage is.
Evidence: Simple JavaScript examples are given to demonstrate the
complexity of processing asynchronous events in JavaScript. Those, along
with narratives of the author�s development experiences, serve as
justification for the creation of the Flapjax language.
Prior/Competitive Work: The authors provided an authorities and detailed
review of prior and competitive work; a major asset of this paper. Some
highlights: Flapjax borrows its main ideas from FRP and FrTime. Stream
processing languages and systems such as Yahoo! Pipes, StreamIt,
Borealis, and Aurora all precede Flapjax and offer event processing in
streams. Open Laszlo allows for variables to be bound to user interface
elements, but differs from Flapjax in that lacks its glitch-freedom.
Alternatives such as MapJAX mask AJAX communication details by instead
providing a virtual shared memory and locking interface.
Reproducibility: Little to reproduce in quantitative terms. The Flapjax
language compiler and library are freely downloadable. Some of the sites
profiled (resume, contribute) could be recreated as illustrations of
developing in Flapjax.
Question: Open-ended: How will developers take to the event & behavior
model? It seemed a bit foreign to me while reading the paper, but it was
growing on me by the end.
Criticism: 1.) The authors should have made some type of stab at making
a quantitative performance measurement of either memory usage or CPU
usage vs. non-Flapjax-enabled apps, even if it was for one or more of
the simple application stubs presented in the examples. Of course, if
they had I would probably criticized them for a doing a poor evaluation
� I�m sure they couldn�t win!! 2.) Syntactically, it would be nice if
Flapjax distinguished between imperative variables and event/behavior
variables.
Future Work: I think a framework like this will find difficulty being
successful on its own right�I think it would need a higher-level layer
on top (think CPAN on Perl). Developers already using GWT, Dojo, or some
other library might encounter too much inertia in attempting to make the
switch to Flapjax.