Modula-3
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.
properties
Modula-3 has the following properties:
- a clean and robust syntax
- strict and static types
- Ordinal types : integers , lists , characters , truth values
- Subranges of ordinal types
- Sets over ordinal types
- Fields with ordinal types as indexes
- Floating point numbers
- Texts
- Data networks and objects
- Subroutines and functions
- Modules
- Generic modules ( templates )
- partial revelation of subtype relationships
- automatic garbage collection
- Exception handling (exceptions)
- concurrent programming ( threads )
- Separation of safe and unsafe program parts
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.
TYPE
T = OBJECT
a: INTEGER;
METHODS
m (arg: CHAR;) := P;
END;
- 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; );
- have.
- 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.
development
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
- Modula 3 resources with FAQ, bibliography and links to various implementations
- Modula-3: Tutorial for an easy introduction
- Modula-3: Installation under Windows
- Modula-3 newsgroup
- Laszlo Boszormenyi & Carsten Weich, Programming in Modula-3: An Introduction in Programming in Style : program examples ( Memento from August 14, 1997 in the Internet Archive )