*** Welcome to piglix ***

Modula-2

Modula-2
Paradigm imperative, structured, modular, data and procedure hiding
Designed by Niklaus Wirth
First appeared 1978
Typing discipline strong, static
OS Cross-platform
Filename extensions .mod .m2 .def .MOD .DEF .mi .md
Major implementations
ETH compiler written by Niklaus Wirth
GNU Modula-2
ADW Modula-2
Dialects
PIM2, PIM3, PIM4, ISO
Influenced by
Modula, Mesa, Pascal, Algol-W
Influenced
Modula-3, Oberon, Ada, Fortran 90, Lua, Seed7, Zonnon, Modula-GM

Modula-2 is a computer programming language designed and developed between 1977 and 1985 by Niklaus Wirth at the Swiss Federal Institute of Technology in Zurich (ETH Zurich) as a revision of Pascal to serve as the sole programming language for the operating system and application software for the personal workstation Lilith. The principal concepts were:

Modula-2 was viewed by Niklaus Wirth as a successor to his earlier programming languages Pascal and Modula. The language design was also influenced by the Mesa language and the new programming possibilities of the early personal computer Xerox Alto, both from Xerox, that Wirth saw during his 1976 sabbatical year at Xerox PARC. The computer magazine BYTE devoted the August 1984 issue to the language and its surrounding environment.

Modula-2 is a general purpose procedural language, sufficiently flexible to do systems programming, but with much broader application. In particular, it was designed to support separate compilation and data abstraction in a straightforward way. Much of the syntax is based on Wirth's earlier and better-known language, Pascal. Modula-2 was designed to be broadly similar to Pascal, with some elements and syntactic ambiguities removed and the important addition of the module concept, and direct language support for multiprogramming.

Here is an example of the source code for the "Hello world" program:

The Modula-2 module may be used to encapsulate a set of related subprograms and data structures, and restrict their visibility from other portions of the program. The module design implemented the data abstraction feature of Modula-2 in a very clean way. Modula-2 programs are composed of modules, each of which is made up of two parts: a definition module, the interface portion, which contains only those parts of the subsystem that are exported (visible to other modules), and an implementation module, which contains the working code that is internal to the module.


...
Wikipedia

...