Work / Virtual Machine / Runtime

2011-02-19 22:57:52


The executive is a part of the virtual machine runtime that the host program uses to execute programs. When a program is loaded by the executive, any symbols exported by the program are added into the symbol table for the containing environment through a namespace - the name of which matches the name of the program. For example, if you had a program called 'Maths' (with an 's' ;) which exported a symbol named 'Add', you would access such an symbol by calling 'Maths.Add' - either from the host directly or from within another program or native or virtual library.

The executive offers the support of an extensible standard run-time library that provides native functionality to the vm programs. This functionality can both generic to all programs as well as specific to a particular host environment. This is what I intend to expose the actual maths library with (rather than write it as a vm program). The standard run-time library is exposed to the executive through native libraries also.

A program can expose symbols that get invoked on certain system events - i.e. when the program is loaded or unloaded, or when new symbols are added to the symbol table. This enables programs to interact with their environment (i.e. for storing their state etc.).

The executive contains the post-linker module. This module is responsible for late-binding the external symbol calls that remained unresolved at the offline pre-linker stage. The second stage of the optimiser (whole-program optimisation) also resides inside the executive.