Automaton

An automaton is a program that can pause and restart. It has its own local variables and a sequence of instructions. The instructions are executed once the automaton starts running. Once it stops the flow control is returned to the interpreter, but the values of the local variables and the status and position of the instruction sequence are retained, and when the automaton restarts, it will restore the local variable values and the previous execution status.

An automaton doesn't output or return any values, nor does it take any input arguments when it starts. Instead, it works like a computer, and may have a number of ports, which are two-way channels used for data exchange. Data can be manually added to or removed from the ports, but automatons can also be connected through the ports to form a network, in which case one automaton's certain output channel becomes another automaton's input channel.

The purpose of automaton is to simplify complex flow controls and simplify function calls and data exchange. It may help design event-driven programs. At present automatons are an experimental feature. The future version might be implemented using threads provided by the operation system.



Subsections
oz 2009-12-22