Nodal execution

From Organic Design wiki
Revision as of 10:30, 26 November 2006 by Nad (talk | contribs)


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 in a nodes nodeCODE association.

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 definitions need to be compiled into a relocatable binary which can then be dynamically loaded at runtime and executed by reference by nodal reduction like normal. For interpreted languages like PERL, the textual definition is built and executed directly at runtime.

Language independence

At runtime nodal reduction requires a concept to have a function reference in its nodeCODE association for it to be executable, and as described above, if there is no reference to execute, a nodally reducable process executes to build, compile, dynamically load the function and store its reference in nodeCODE. The definition-building process depends on the attributes of the execution environment such as programming language and operating system, but the node in which the resulting executable reference is stored is a node which is the universal concept that the functions code is modelled from.

Functions composed of purely nodal/list-space, logic, program-control or purely algorithmic code can be described nodally so that their definitions can be built automatically for a wide range of languages on demand without any human assistance. This can be done using simple nested textual templates, only exotic functionality like device or memory access require specific language bindings to be written manually.

See also