Hello,
The JavaFX compiler team did a lot of good work, and it would be a
shame to see it go to waste. So thanks for starting this project.
I can't speak publicly about JavaFX 2.0 or other Oracle internal
projects, so until such are publicly released, for the sake of
discussion here, I'll have to pretend they don't exist.
Although there are many things that could be improved, from my
observations of the presidio compiler from which I assume this project
forked, the most significant problem imo is the incomplete design/
implementation of lazy binding.
Lazy evaluation of binding is a strategy to avoid exponential
recomputation costs.
The basic idea is pretty simple. namely that when an update to a
variable is performed, dependent bound variables are not immediately
recomputed, but rather, such variables are transitively marked
(potentially) invalid. It is only when such invalidated variables are
subsequently read, that their bindings _may_ be evaluated, namely if
and only if the inputs to the variable's binding expression have
changed.
Although, the presidio compiler does contain most of the
infrastructure to perform lazy binding, it currently fails in (at
least) several important cases, namely sequence variables, and
function calls.
In addition, the current design dictates that triggers are called
eagerly (from the update site), and thus forces eager evaluation of
bindings they depend on.
AFAICT the current compiler design visits the variable dependency
graph in two passes on each update. The first pass performs
invalidation, the second pass is to execute triggers. Having two
passes is inefficient.
I believe these issues primarily stem from the compiler team's
attempts to optimize sequence slice triggers - but given the
prohibitive cost of eager binding in the presence triggers, such would
be to be avoided in the first place.
Lazy sequence triggers are conceptually possible, but would have their
own costs, namely application of Myers algorithm to compute the deltas
to feed the trigger.
The first step imo is to ensure the invalidation pass operates
correctly in the absence of triggers, and secondly to examine the
trade-offs of lazy and eager triggers.