Anything dataflow is about asynchronous, autonomous, distributed systems -- unlike von-Neumann machine with cenral control (program counter), it needs distributed control where arrival of data represents control
Reactive systems are open systems and need to respond to a continual stream of stimuli from an environment which which they cannot synchronize.
Some argue that streams and functions on streams are a natural way to model reactive systems.
Two ways to model streams:
Recursive cons-model (Landin): defines streams recursively e.g. using cons-like list constructors -- treats them functionally using lazy semantics
Can be thought of as (Python) generator -- coroutine that may be considered to be a particular method of representing a list in which the creation of each list element is delays until it is actually needed.
Scheme models streams as two-element cell -- car contains the value of the head of the stream and cdr contains the procedure that computes the rest of the stream
I-structures used in dataflow languages
Channels: not functional because it is modified by appending new elements to it
var running =true; // Set false to stop.while (running) {
var time =await window.animationFrame;
context.clearRect(0, 0, 500, 500);
context.fillRect(time %450, 20, 50, 50);
}