Wed Jun 7 14:46:23 EDT 2017
While driving, this struck me:
- the model is functional (= directed, acyclic)
- the user input is unambiguous ("one hand")
- the user presentation is where "choice" pops up
The main insight is that the choice is where the user uses its "one
hand". Then extended, multi-hand is possible as long as the controls
are not linked through constraints.
Basically, when the user "chooses" one side of the view, the other
side is no longer an input, but becomes a presentation, functionally
dependent on the active input.
The topology is something like this:
- DAG (engine) - constraint network (presentation+input) - DAG (presentation)
It is the combined presentation and input that causes the problems:
this is almost always multi-faceted. Change one "knob", and others
At the point the user picks one of the linked controls, the network is
directionalized and the problem reduces to FRP.
So, the two main problems are to implement:
- functional reactive programs
- directionalization of constraint networks
EDIT: The thing is, if the whole model is recomputed, these cyclic
things can disappear. The view is always a deterministic rendering of
the model. It is not necessary to directionalize anything.
Maybe that is exactly what the react approach solves? Recompute
everything, then optimize redraws through diffing. This as opposed to
directionalizing constraints. It just bypasses all the hairy stuff.
In an animated gui, there is never a need for any directionalization
if the gui gets updated as a whole on each frame. With the ubiquity
of GPUs this should be assumed.
Then, it might be possible to do the tree-diffing when no GPU is
EDIT: Two approaches:
- model recompute + tree diffing to compute imperative updates
- constraint directionalization