The Programming Environment

The previous section summarized the essence of the Omega language. The reader may have noticed that the language does not contain any elements for the declaration of types (i.e., the introduction of new prototypes) and methods. All these operations are performed interactively in the programming environment by means of menu commands. The programming environment operates on a workspace and provides views of several aspects of the workspace in windows, as shown in Figure 1. The most important parts of an Omega workspace are

In order to ensure integrity among its various parts, a workspace is always processed as a whole. Is is loaded from a disk file at the beginning of an Omega session and saved back to disk at the end of the session. During a session, the current state of the workspace can be captured in a disk file at any time. In this way, adverse effects of programming errors can be reduced to a minimum.

Figure 1: Snapshot of an Omega Session


The Prototype Hierarchy

The most important view of a workspace is the prototype hierarchy. It is displayed in the prototype browser. All prototype-related operations, such as creation, deletion, renaming and reordering of prototypes, are performed directly in this window through menu commands. It is important to note that the items displayed in the hierarchy window represent types as well as prototypes. That is, every entry represents a prototypical object that can be opened for inspection in a window.


The Object Editor

An object editor window shows either the structural or the behavioral aspects of an object. In the structure view, instance variables of an object can be added, removed, renamed, and redeclared. The menu commands Copy and Paste are used to perform assignments without having to write a single line of code. Figure 2 shows the dialog that appears when the New Variable command has been issued.

Figure 2: New Variable Dialog

When a new instance variable is defined, the following information must be supplied:

The method view of an object shows all methods that have been defined for that object. It shows not only those methods defined in the actual type of the object, but also all inherited and overridden methods. Figure 3 shows the dialog resulting from the invocation of the New Method menu command.

Figure 3: New Method Dialog

When a new method is defined, its name, the argument types, the result type, and the visibility of the method must be specified. It is also possible to protect a method against inadvertent overriding in subtypes. From the method view of an object editor, the source code of a method can be displayed in another window by means of a menu command.


Interactive Execution

An Omega workspace consists of a collection of interconnected objects, but there is no such thing as a main program. The programming environment provides a log window in which arbitrary expressions can be entered and executed by means of a menu command. The result of the execution of the last expression is then displayed in the log window. The following fragment shows the result of the evaluation of an expression.

  myself::=persons lookup:"Blaschek";  -- evaluated
  mySelf cityAndZipCode                --   expression
 
  >>A-4040 Linz                        --result of evaluation

A special prototype Application serves as the basis for the construction of interactive programs. A "main program" can thus be constructed by deriving a new prototype from Application and overriding a few methods. The programming environment contains an application generator that converts such a prototype into a stand-alone application that can be executed independently of the programming environment.



The Compiler

The Omega compiler is integrated in the programming environment. It operates on a persistent symbol table and compiles method sources into native 680x0 code. Since there is no module concept in Omega, methods are the compilation units of Omega. This enables the compiler to automatically recompile inconsistent methods in the background (i.e., during input pauses). The compiler performs some simple optimizations. In particular, it generates efficient inline code for operations with monomorphic types. As a result, Omega programs are five to eight times faster than comparable Smalltalk programs.


Analysis and Documentation Tools

The Omega programming environment not only provides functionality for the construction of programs but also supports inspection, debugging and documentation. These features include:


Previous Sections:

Following Sections:


This page has been visited times.