Mon Nov 13 10:01:32 EST 2017
Compile time pipes
A good way to look at the idea is to see it as compile time pipes:
tasks have byte-level interfaces, and can read/write one byte at a
time. The task of the DSL / compiler writer is to make this
Anything else can be built on top of that.
Is this CSP channels?
But once byte channels are there, one probably also wants object
channels. Those need a central store. This might be a problem.
Is it possible to keep it "linear", e.g. always copy objects?
Byte channels might be too simplistic, but they do compile well down
to any architecture. Let's give it a try.
These are byte channels. Buffers are not needed: when one byte is
written, the reader can continue to execute. Buffering is then an
implementation detail and it should be possible to visualize a program
in a graph to see where buffering would be beneficial.
When buffers are added, yielding is necessary, to indicate "done for
now", time to switch tasks.
The elements then become:
- Write programs in terms of byte pipes, or word pipes, or whatever
unit makes sense for the program. Often though, microcontrollers
need to do byte-oriented protocols, so bytes are probably a good
- Observe that execution speed comes from buffering writes and reads,
which removes task switch overhead for the producer and consumer
- Make the entire connectivity graph concrete, and annotate it with
static buffer sizes.