Sat Mar 1 00:51:13 CET 2014
Data Direction and Control Flow: 2 x 2 = 4
A little arcane, but quite fun. Do you push or pull data? It
Some types, using dataflow parameters (as in Oz, easly
poor-man-modeled usin C++ references or C pointers.)
- sink : write(from x)
- source : read(to x)
- operation : process(to y, from x)
These can be neatly composed:
sink * op = sink
op * source = source
op * op = op
Now, what I often forget is that these have duals. There's a thing
that "puts something in a sink", and a think that "pulls something
from a source".
In practice, what are these co-objects (anti-objects)? If sink,
source, and operations are models of data processing (push, pull and
flow), the co-objects correspond somehow to physical ports or the
operating system transferring control flow to a program when an event
occurs. A co-sink is something that writes into a sink. Note that an
co-sink is not a source! The asymmetry is the caller/callee relation.
| caller callee
sink | sends receives
source | receives sends
process is caller for both send and receive.
then there's a missing 4th case: the buffer, which is callee for both
send and receive.
It seems that "push" programming (sink-oriented programming) is the
most natural, as it has pysical-time coinciding with execution on a
So is "pull" programming (function evaluation) then only a model? Is
the concept of evaluation just upside down?