A live updated data structure is represented as a RecordScope, which extends
the base Swim Structure Record class. An ordinary Record can be recursively
compiled into a RecordScope by invoking the RecordScope.create factory method.
A compiled RecordScope has all of its nested expressions replaced by their
evaluated state. Unlike evaluating a Record with an Interpreter, if a
member of a RecordScope changes, all expressions that transitively depend on
that member get flagged for recomputation, which occurs the next time
recohereInput gets invoked on the RecordScope.
The Dataflow.compile method can also be used to compile an arbitrary
Swim Structure expression into an Outlet that updates whenever
the state of any of its transitively dependend expressions changes.
The Swim Dataflow library implements a compiler from dynamic structure expressions to live-updated documents driven by streamlet dataflow graphs.
Overview
A live updated data structure is represented as a
RecordScope
, which extends the base Swim StructureRecord
class. An ordinaryRecord
can be recursively compiled into aRecordScope
by invoking theRecordScope.create
factory method. A compiledRecordScope
has all of its nested expressions replaced by their evaluated state. Unlike evaluating aRecord
with anInterpreter
, if a member of aRecordScope
changes, all expressions that transitively depend on that member get flagged for recomputation, which occurs the next timerecohereInput
gets invoked on theRecordScope
.The
Dataflow.compile
method can also be used to compile an arbitrary Swim Structure expression into anOutlet
that updates whenever the state of any of its transitively dependend expressions changes.