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 StructureRecordclass. An ordinaryRecordcan be recursively compiled into aRecordScopeby invoking theRecordScope.createfactory method. A compiledRecordScopehas all of its nested expressions replaced by their evaluated state. Unlike evaluating aRecordwith anInterpreter, if a member of aRecordScopechanges, all expressions that transitively depend on that member get flagged for recomputation, which occurs the next timerecohereInputgets invoked on theRecordScope.The
Dataflow.compilemethod can also be used to compile an arbitrary Swim Structure expression into anOutletthat updates whenever the state of any of its transitively dependend expressions changes.