Hyper Programming

From SystemsResearch

Jump to: navigation, search

Traditionally programs are represented as linear sequences of text. Where a program accesses another object during its execution, it contains a textual description of that object, describing how to locate the object. At some stage during the software process the description is resolved to establish a link to the object itself. Commonly this occurs during linking for code objects and during execution for data objects, and the environment in which the resolution takes place varies accordingly. There is no guarantee that a textual description of an object will remain valid until the time of its resolution, even if it is valid at the time that the program is written.

In such systems programs are constructed and stored in some long-term storage facility, such as a file system, separate from the run-time environment which disappears at the end of each program execution. By contrast, in persistent systems, programs may be constructed and stored in the same environment as that in which they are executed. This means that objects accessed by a program may already be available at the time that the program is composed. In this case direct links to the objects can be included in the program instead of textual descriptions. A program containing both text and links to objects is a hyper-program.

An example of a hyper-program is shown below. The links embedded in it are represented by non-textual tokens to allow them to be distinguished from the surrounding text. The first link is to a first class procedure value writeString which writes a prompt to the user. The program then calls another procedure readString to read in a name, and then finds an address corresponding to that name. This is done by calling a procedure lookup to look up the address in a table data structure linked into the hyper-program. The address is then written out. Note that code objects (readString, writeString and lookup) are denoted using exactly the same mechanism as data objects (the table). Note also that the object names used in this description have been associated with the objects for clarity only, and are not part of the semantics of the hyper-program.

An example is shown below of the user interface which might be presented to the programmer by a hyper-program editing tool. The editor contains embedded light-buttons representing the hyper-program links; when a button is pressed the corresponding object is displayed in a browser window. The browser is also used to select persistent objects for linking into hyper-programs under construction.

The benefits of hyper-programming include:

  • being able to perform program checking early: access path checking and type checking for linked components may be performed during program construction;
  • being able to enforce associations from executable programs to source programs: links between source and compiled versions may be used;
  • support for source representations of all procedure closures: free variables in closures may be represented by links, thus allowing hyper-programs to be used for both source and run-time representations of programs; and
  • increased program succinctness: access path information, specifying how a component is located in the environment, may be elided.

Further Information

Personal tools