Modula-2 is a strongly typed, imperative programming language that was developed in the late 1970s by Professor Niklaus Wirth at the Swiss Federal Institute of Technology in Zurich (ETHZ) as a system implementation language for a Macintosh like personal computer workstation project called Lilith. Modula-2 is based on Wirth's earlier languages Modula and Pascal. In response to several criticisms of Pascal, Wirth improved on the Pascal design in Modula-2, most notably:

Standards and Dialects Edit

Wirth published the Modula-2 language specification under the title "Programming in Modula-2" for which three revised editions appeared in print by Springer Verlag. Each revision made minor changes to the language specification and the resulting "dialects" are commonly referred to as PIM, PIM2, PIM3 and PIM4. Most of the available Modula-2 compilers available in the 1980s followed either the PIM2 or the PIM3 standard.

Towards the end of the 1980s, an international standardisation committee was formed at the International Standards Organisation (ISO). The resulting Modula-2 ISO standard was ratified and published in 1993. Compilers developed since then usually follow the ISO standard or a subset thereof. The main differences between ISO and the PIM standards are:

  • no assumptions about the underlying hardware architecture, e.g. numer of bits in a byte does not necessarily have to be 8 (as required in C)
  • various clarifications on semantics where PIM did not specify them
  • behaviour of REM and MOD when used with negative arguments
  • string literals can be concatenated (using "+")
  • delimiters for compiler pragmas are "<*" and "*>"
  • structured value constructors
  • module finalisation
  • exception handling
  • type COMPLEX
  • a standardised library

Following the ratification of the base standard, the ISO working group produced two optional standard extensions, one for object oriented language extensions and another for generic language extensions.

Modula-2 Grammars Edit

Current Modula-2 Compilers Edit

There have been many Modula-2 compilers for microcomputers and personal computers in the 1980s, most of which have since disappeared or are for platforms which have since disappeared. Most web sites with information about Modula-2 list so many of these abandonware compilers that an unaware person in search for information will find it very difficult to find the compilers which are actually available for use on current computer platforms. The following list of Modula-2 compilers therefore shall not repeat this mistake and only list the compilers which are relevant in the 21st century. Operating systems such as CP/M, Atari TOS, the classic Amiga OS, the classic Macintosh OS and OS/2 are certainly still in use by some people but they are no longer relevant.

Current Open Source Modula-2 Compilers Edit

  • GNU Modula-2, a Modula-2 front-end for GCC, PIM2/3/4 and ISO, still under development but functional
  • M2M, the original M-code Modula-2 compiler by ETHZ, PIM2, generates code for a virtual machine and is therefore portable and still functional
  • Objective Modula-2, PIM3 with language extensions for Cocoa/GNUstep, still under development, front-end functional

Current Commercial Modula-2 Compilers Edit

  • Canterbury Modula-2, written in Java, generates Java source code
  • Gardens Point Modula-2, for Unix systems and .NET CLR
  • MOD51 Modula-2, targeting 8051 type embedded controllers
  • MOCKA Modula-2, PIM3, executable for Linux available free of charge
  • p1 Modula-2, ISO, for Macintosh, demo-version available free of charge
  • Waterloo Modula-2, PIM3, for VM/SP CMS (IBM Mainframe OS)
  • XDS Modula-2, ISO, executables for Linux and Windows available free of charge

Further readingEdit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.