from Wikipedia, the free encyclopedia

Modula-3 is an imperative , object-oriented programming language . It sees itself as the successor to Pascal , Modula-2 , Modula-2 + and Cedar and was developed by DEC and Olivetti . It was developed in the tradition of languages ​​by Niklaus Wirth under the aspects of simplicity and rigor, but Wirth was only involved in the development as a consultant. The simplicity here refers to the scope of the language (the Modula-3 language definition comprises 60 pages) and not to the length of the programs or to an orientation towards personal programming habits.


Modula-3 has the following properties:

The above concepts were implemented in a downright minimalist way. This will make it easier for someone familiar with these concepts to get started.

  • Object orientation essentially consists of the OBJECT type.
    T = OBJECT
          a: INTEGER;
          m (arg: CHAR;) := P;
This defines the type T for objects that contain the object variable a and the method m . The method m is implemented by assigning a procedure P to it. This must be the signature
 PROCEDURE P (self: T; arg: CHAR; );
There are no excellent methods like constructors and destructors. However, object variables can be set to a defined initial state by type definition.
  • Encapsulation is achieved through the separation in interface and implementation known from Modula-2 . By partially revealing subtype relationships (REVEAL), any fine gradations of access options can be defined. In a sense, this is a generalization of the public - protected - private hierarchy and friends conventions of C ++ .
  • Data structures parameterized with types can be implemented with generic modules . Generic modules differ from normal modules in terms of module parameters. In a certain way, you can use it to keep selected IMPORT statements variable. The disadvantage of this simple implementation is that generic modules cannot be translated directly, only their characteristics.


The DEC was sold to Compaq in 1998 ; this in turn went into 2002 in Hewlett-Packard . Maintenance and further development of the sources of the most important Modula 3 compilers was taken over by Elego Software Solutions . Since the takeover, Critical Mass Modula-3 in particular has been continuously developed. The sources and binary packages for a number of operating systems can be downloaded for free (under a less restrictive license compared to the GPL, for example).

Web links