Nodal execution

From Organic Design wiki
Revision as of 02:16, 24 November 2006 by Rob (talk | contribs) (Function definitions)

In the nodal model the program-flow aspect of execution is handled by the nodal reduction algorithm, but the bottom level of functionality which can't be reduced must be in the form of statements of the execution language. The form of these statements is specific to the runtime environment, but would usually be a function which can have its reference associated with a node.

Function execution

When nodal reduction executes a function, the variables this and parent are node references made available in the functions scope so that it works in a similar way to a method in object-oriented programming.

Function definitions

An acronym used within the nodal model is DOFU which stands for Define On First Use. In the nodal model some nodes represent locally executable functions. When nodes such as these recceive a quantum of executional attention but there is not function reference to call, the quantum is sent into the node which results in the definition building process for that function being put into the currently executing loop. After the definition has been built, the original node will still be in the loop for execution, but will now exhibit a function reference which will be able to execute when the next quantum arrives.

The definitions are built from a nodal representation which is simply a nested structure of textual patterns like any other interface or storage object. The nodal structures are the definitions are language independent and exhibit specific textual patterns and rules which are related to the execution environment.

For compiled environments like C this would normally involve either a restart or the creation of a shared object. But if the definition is a pattern composed only of already compiled functions like maths or nodal functions then the nodal version of the definition could be interpreted at runtime rather than built into a textual definition. For interpreted languages like PERL, the textual definition is built and executed directly at runtime.

See also