Modula-2


modula-2

[′mäj·ə·lə ′tü] (computer science) A general-purpose programming language that allows a computer program to be written as separate modules which can be compiled separately but can share a common code.

Modula-2

(language)A high-level programming language designed byNiklaus Wirth at ETH in 1978. It is a derivative ofPascal with well-defined interfaces between modules, andfacilities for parallel computation. Modula-2 was developedas the system language for the Lilith workstation.

The central concept is the module which may be used toencapsulate a set of related subprograms and data structures,and restrict their visibility from other portions of theprogram. Each module has a definition part giving theinterface, and an implementation part.

The language provides limited single-processor concurrency(monitors, coroutines and explicit transfer of control)and hardware access (absolute addresses and interrupts).It uses name equivalence.

DEC FTP archive.

["Programming in Modula-2", N. Wirth, Springer 1985].

Modula-2

(MODUlar LAnguage-2) An enhanced version of Pascal introduced in 1979 by Swiss professor Nicklaus Wirth, creator of Pascal. It supports separate compilation of modules, allowing it to be used for large projects. The following example changes Fahrenheit to Celsius:

 module FahrToCent; from InOut import ReadReal,WriteReal, WriteString,WriteLn; var Fahr:real; begin WriteString("Enter Fahrenheit "); ReadReal(Fahr); WriteLn; WriteString("Celsius is "); WriteReal((Fahr - 32) * 5 / 9); end FahrToCent