Synchronization would be a nightmare, but I think it would be a fun exercise to see what you could do in that framework.
Synchronization would be a nightmare, but I think it would be a fun exercise to see what you could do in that framework.
The nice thing about this approach is that you can emulate blocking or non-blocking I/O within the same function or even against the same file descriptor. And processes are so cheap that if your callees do block in unexpected ways you can just move that one call into its own process that just sends you a message when it's done.
You don't get what you would normally think of as "while loops" though, which makes sense if you think about it.
I think the idea most similar to what the grandparent wants is instruction-level dataflow, where programs are DAGs, and instructions are only run when their inputs are ready, rather than when a program counter reaches them.
Physical dataflow machines were built that did this in hardware.
http://docs.openstack.org/developer/taskflow/
https://pypi.python.org/pypi/taskflow
And yes u can do things like built equation solvers to:
http://docs.openstack.org/developer/taskflow/examples.html#l...
And other neat things:
At a low level, that's exactly what modern CPUs do.