Guided Demonstration of Oberon/F, Version 1.0 Mac.
This Demo
This text is a brief introduction to Oberon/F. Read it and follow the small hands
on examples to get a feeling for the concepts and working model of Oberon/F.
Oberon/F
Oberon/F is an integrated cross
platform development system for the language Oberon. Currently, versions for Macintosh System 7 and Windows 3.1/NT 3.1 are available; other versions are planned. Oberon/F fully exploits the platform-specific user interface. Access to the underlying platform is possible, but can be isolated into special low-level modules. All modules relying on portable interfaces only, which includes most of the Oberon/F services, are fully portable, and still adopt the platform
specific look-and-feel.
The development environment for Oberon/F is identical with the production run
time environment of Oberon/F, enabling rapid development. The language Oberon is statically type
checked, fully type-safe, and garbage collected. Being a direct descendant of Pascal and Modula
2, it is easy to learn and to teach, programs are legible, and various programming paradigms, including object
oriented programming, are easily expressed. Oberon is simple enough to serve as a scripting language, yet powerful enough to enable system
level programming: Oberon/F itself is entirely written in Oberon. The Oberon compiler produces fast, native, 32-bit code. The system uses dynamic linking to completely avoid explicit linking steps in the development cycle.
Oberon/F is a fully extensible open framework. New subsystems, at equal footing with the standard texts, forms, and development subsystems, can be added freely and easily. Existing subsystems can be extended to accommodate new needs. Still, traditional double
clickable applications can be created as well.
Oberon/F is based on a compound document model; it is planned to adopt OLE 2.0 and OpenDoc in the future. Embedded document parts can be edited and resized in place. This demo text contains several embedded parts. Here is a first one: A non
portable Macintosh PICT
2 view (without editing capabilities); it can be resized by first clicking into the picture, then selecting it by clicking into the grey border lines, and finally dragging the displayed resize handles. Resizing constraints are resolved on the fly: In the example, the PICT view stays in proportion.
A PICT
2 viewer as an example of an embedded document part
The Oberon/F framework supports drag & drop editing (integration with the finder "clippings" mechanism is not yet available). To copy, hold down the option key when starting to drag.
An embedded object can be edited as a part of the embedding text. To avoid focusing an embedded part when trying to select it as a whole, hold down the command key while clicking into the part. (When clicking into a part while holding down the shift key in order to extend a selection, focussing is also disabled.)
Almost all operations in Oberon/F are subject to a multi
level undo/redo feature. (In fact, the framework makes it so easy to program something in an undoable fashion that it is almost more involved not to do so.)
Program Development
The following embedded part is a fully editable text, showing the complete source of a small Oberon module. To compile the module, focus the embedded part by clicking into it, and then execute Compile from menu Dev.
SamplesEx0 is a minimal "hello world" program in Oberon. It writes a single line to the system log text. Execute Open
Log from menu Dev to display the system log, if it isn't open already.
Exported items in Oberon modules are marked by a trailing asterisk; there are no separate header files, definition modules, or the like. Consistency of interfaces and implementations is fully checked by the compiler; version integrity is checked by the dynamic linker.
Module SamplesEx0 exports a single command Do. Commands are Oberon procedures that have no explicit parameters; they can be executed directly from the user interface. There is no need for a top
level module or a "main" procedure. A command can be added to a menu, attached to a button, or executed directly from within a text. To do the latter, the name of the command must be preceded by the name of the implementing module:
SamplesEx0.Do
To execute a command by name, simply select the command string and execute Execute from menu Dev. Another possibility is to precede the command name with a special embedded part, called a commander
that can be inserted anywhere into a text using Insert
Commander from menu Dev. Clicking on a commander executes the appropriate command.
If the source contains errors detectable by the compiler, these are flagged directly in the text. For example, the following module version erroneously imports the (non
existing) module Outo, instead of Out. Try to compile the module - the compiler inserts special embedded parts, error markers, flagging the errors that it found. (The compiler also writes a report to the system log.)
By clicking on an error marker, it is expanded to display a short error message. Correct the mistake (delete the superfluous o in IMPORT Outo), and compile again. The marker disappears, and the module is compiled successfully.
The set of currently loaded modules can be inspected using Loaded
Modules from menu Info. The interfaces of modules (loaded or not) can be displayed using the browser: Select a module name and execute Interface from menu Info.
A module remains loaded until it is explicitly unloaded, or until the system is restarted. To unload a module, select the module name and execute Unload
Module
List from menu Dev. For example, unload SamplesEx0, modify the string "Hello world", recompile SamplesEx0, and activate SamplesEx0.Do again. Note that your changes do not affect the running system until after you have unloaded the old module. Such an explicit unloading is a very useful mechanism to allow major changes in multiple modules, while still using and working with the previous version. (Consider editing the Oberon/F system editor with itself...)
Linking Programs to Forms
Besides the text and programming subsystems, the standard Oberon/F configuration also comes with a forms subsystem, including a visual designer.
The following module defines a simple record variable to be used for a data entry form.
After compiling the module, a dialog box can be created for the variable Addresses.adr using command New
Form... from menu Dev. Just enter the name of the exported global variable Addresses.adr into the link field, and click on the Create button. The type information extracted by the compiler is available to Oberon/F at run-time, which is used to automatically create a data-entry window for the form, with a simple default layout.
The created layout can be edited, and then opened as a dialog using the Open
Dialog
(Aux) command in menu Dev.
The text entry fields and the checkbox are directly linked to the fields name, email, and getsUpdates of the variable Addresses.adr. The button is linked to the field Text, a procedure variable initialized to refer to procedure Text in module Addresses. Clicking the button causes procedure Text to be called. In turn, a new text is created, a report based on the variable adr is written to the text, a new text view is created, and used to open a window displaying the report. Next, the dialog variable is cleared and the system is notified that the variable has changed, causing the form's display to resynchronize with the changed variable.
A form can be saved from within the visual editor; thereafter it can be attached to a menu entry, or another dialog's button. Dialogs are saved in the standard document format, and in a platform
independant way.
And more ...
After this first impression, you may want to consult your documentation for an in-depth coverage of Oberon/F. The file Manuals:Roadmap gives an overview over the available documentation.