Welcome to the Dictionary of Programming Languages, a compendium
of computer coding methods assembled to provide information and
aid your appreciation for computer science history.
Browse the dictionary by clicking on a section:
Get a full dump of the dictionary:
List of Names
- Language type:
Modula-2 is a procedural, block-structured
language intended for application programming
and computer science education. It
was designed to foster good software
engineering practices, and also to remedy
some of the shortcomings of its predecessor,
Pascal. Modula-2 has very good support
for program modularity: named modules,
and data hiding. It also featured strong
type checking, a variety of conventional
data types, dynamic arrays, and concurrency!
Modula-2 was designed to support the
construction and maintenance of real
application software systems (unlike Pascal).
Its support for concurrency and dynamic
memory management are also better than
Pascal, allowing the programmer more
flexibility. The syntax of Modula-2
is also less rigid than that of Pascal,
allowing the programmer to declare
variables and other items nearer to
where they are used.
Lastly, Modula-2 support function signature
type checking across module boundaries.
Modula-2 compilers are available, with
a little searching, for most platforms:
Unix systems, PCs, and VMS, and even
some cross-compilers for embedded systems.
Both free and commercial compilers are
available, but some may be a bit old. There
is at least one Modula-2 system, by XDS,
that can generate C code from Modula-2 code,
to improve portability.
A fair number of utility, math, data
handling, distributed computing,
and other libraries are available
for Modula-2 programmers.
In its original niche,
Modula-2 has been partly superseded by
Modula-3, Oberon, and Ada.
- See Also:
Modula-2 enjoyed some degree of adoption
in the early 1980s, especially for
software engineering education. Many
commercial compilers were written for it.
Modula-2's features and semantics
had substantial influence on the design
of Ada. Unfortunately, while Modula-2
allows construction of abstract data types,
it does not support inheritance and
therefore was not able to fully support
the paradigm of object-oriented programming
that became popular in the late 1980s.
There were several variations of Modula
created in the 1980s, including a data-parallel
dialect called Modula-2* designed for
massively parallel computers.
- Sample code:
(* Randomize the alphabet, and show how to use the module Shuffle *)
(* John Andrea, 1992 *)
FROM InOut IMPORT WriteLn, WriteString;
FROM Shuffle IMPORT Deck, Create, Next, Reset;
i, j, min, max, n :CARDINAL;
min := ORD( 'a' );
max := ORD( 'z' );
n := max - min + 1;
Create( d, min, max );
FOR i := 1 TO 10 DO
WriteString( 'random alphabet = ' );
FOR j := 1 TO n DO
WriteString( CHR( Next( d ) ) );
Reset( d );
Descriptions in this dictionary are ©1997-99 Neal Ziring. Some
examples copyright of their respective authors. Some
technologies and languages are trademarked. Permission to
copy descriptions is granted as long as authorship credit is preserved.
Comments on this dictionary, corrections and suggestions, are all welcome.
Please use email, the address is email@example.com
[Ziring MicroWeb Home]
Dictionary and script maintained by Neal Ziring, last major modifications 3/18/98. Most recent
additions to dictionary and master list, 1/00.