Oberon (programming language)

from Wikipedia, the free encyclopedia
Oberon
ETH Oberon Logo
Basic data
Paradigms : imperative , structured , object-oriented
Publishing year: 1987
Designer: Niklaus Wirth
Developer: Niklaus Wirth , Juerg Gutknecht
Influenced by: Pascal , Modula-2
Affected: Component Pascal , Active Oberon
License : http://rightsstatements.org/page/InC-NC/1.0/
www.projectoberon.com

Oberon is an object-oriented , strictly structured programming language developed by Niklaus Wirth and Jürg Gutknecht . It is quite similar to the predecessors Pascal and Modula-2 , which were also designed by Wirth , but more structured than Pascal and more powerful, but at the same time considerably less extensive than Modula-2. It was first published in 1987. The ETH Oberon system is an independent operating system from ETH Zurich that is implemented in the Oberon language, served as the development basis for the language and, like the compiler, is available free of charge.

overview

Like its predecessor Modula-2  , Oberon was developed in parallel to a workstation ( Ceres ).

After its publication, Oberon was quickly used, among other things, for educational purposes in schools and universities. In the meantime, however, there are also tools based on Oberon, also available free of charge, which are also used commercially, such as the programming language Component Pascal and the integrated development environment BlackBox Component Builder .

The advantages of Oberon lie particularly in the modular structure, the high level of security and the simplicity of the language, which can be clearly and comparatively briefly defined (see also EBNF ) . With Oberon, it is particularly easy and safe to split the programming between different people and to put the work together later.

Hanspeter Mössenböck has further developed Oberon with a few changes to the programming language Oberon-2 , whereby in addition, essentially explicitly type-bound procedures were allowed so that the corresponding objects no longer have to be implicitly listed in the formal parameter list of the methods . In addition, the export mark "-" (as an alternative to "*") was introduced to suppress write access to objects or their components.

The source texts of the compilers are usually freely available. There are various integrated development environments, for example POW! . In addition to its use as a programming language, it can also be used as an operating system (Native Oberon).

In contrast to other full-fledged, object-oriented programming languages, the source text is not interpreted ( e.g. Ruby ) or translated into bytecode (e.g. Java ), but is usually translated very quickly into machine language in a single compiler run . The compiled code is type safe and space checks are mandatory. The use of program statements to deallocate pointer variables is obsolete.

It is possible to set breakpoints (HALT instruction) and also to analyze all local variables after the program has been aborted. Global variables can be analyzed in the runtime system at any time. The development times with Oberon are therefore very short, and the machine code is still very efficient and robust. Real-time applications can also be implemented with Oberon.

The Oberon programming language is characterized by the fact that it fully supports the object-oriented architecture, in contrast to C ++ , for example, with an integrated Oberon runtime system and automatic garbage collection . In multiple inheritance was deliberately to relieve the compiler of complex administrative tasks and the programmer before unexpected results related to the Diamond problem to maintain.

Code examples

Hello World in the Ulm OBERON system:

  MODULE HelloWorld;

  IMPORT Write;

  BEGIN

    Write.Line("Hello World");

  END HelloWorld.

Object-oriented programming is with advanced data networks from data type RECORD reached. The definition of methods is achieved by type-bound procedures, and the definition of visibilities is achieved by export marks ("*" for write access and "-" for read access). Example in Oberon-2:

 MODULE Vererbung1;

 TYPE

    GraphischesObjekt* = POINTER TO GraphischesObjektBeschreibung;
    GraphischesObjektBeschreibung = RECORD farbe*: LONGINT; END;

    Punkt* = POINTER TO PunktBeschreibung;
    PunktBeschreibung = RECORD (GraphischesObjekt) x*, y*: LONGINT; END;

    Linie* = POINTER TO LinienBeschreibung;
    LinienBeschreibung = RECORD (GraphischesObjekt) xStart*, yStart*, xEnde*, yEnde*: LONGINT; END;

 PROCEDURE (punkt: Punkt) Zeichne*;
 BEGIN
    ...
 END Zeichne;

 PROCEDURE (linie: Linie) Zeichne*;
 BEGIN
    ...
 END Zeichne;

 VAR

    punkt1: Punkt;
    linie1: Linie;

 BEGIN

    NEW (punkt1);
    punkt1.x := 1;
    punkt1.y := 1;
    punkt1.Zeichne ();

    NEW (linie1);
    linie1.xStart := 1;
    linie1.yStart := 1;
    linie1.xEnde  := 2;
    linie1.yEnde  := 2;
    linie1.Zeichne ();

 END Vererbung1.

Attributes that only have read access can be changed using type-specific procedures (methods). Example:

 MODULE Vererbung2;

 TYPE

    Objekt* = POINTER TO Objektbeschreibung;
    Objektbeschreibung = RECORD x-: INTEGER; END;

 PROCEDURE (objekt: Objekt) SetzeX* (wert: INTEGER);
 BEGIN
    objekt.x := wert;
 END SetzeX;

 VAR

    objekt1: Objekt;
    int: INTEGER;

 BEGIN

    NEW (objekt1);
    objekt1.SetzeX (1);
    int := objekt1.x;

 END Vererbung2.

Further developments

The programming languages Component Pascal , Active Oberon and Zonnon were developed based on Oberon and Oberon-2 .

See also

literature

  • Martin Reiser: The Oberon System. Paperback, 300 pages, Addison-Wesley, 1991, ISBN 0-201-54422-9 .
  • Martin Reiser, Niklaus Wirth: Programming in Oberon - Steps beyond Pascal and Modula. Paperback, 336 pages, Addison-Wesley, 1992, ISBN 0-201-56543-9 .
  • Niklaus Wirth, Jürg Gutknecht: Project Oberon. Hardcover, 560 pages, Addison-Wesley, 1993, ISBN 0-201-54428-8 .
  • Martin Reiser, Niklaus Wirth: Programming in Oberon: The new Pascal. Addison-Wesley, 1994, ISBN 3-89319-657-9 , 2nd corrected reprint 1997.

Web links

Individual evidence

  1. POW !, an IDE for Oberon
  1. Wirth, N .: From Modula to Oberon and the programming language Oberon. In: ETH Technical Report, Computer Systems, Volume 82. Eidgenössische Technische Hochschule Zürich, 1987, accessed on January 2, 2020 (English).
  2. Ulm OBERON system