Modula-2

From EDM2
Jump to: navigation, search
Niklaus Emil Wirth
The designer of Pascal, Modula-2 & Oberon

Structured procedural systems language introduced by Niklaus Wirth in 1979, based on his earlier Modula language that in turn had taken its structure and keywords from the even earlier Pascal teaching language, but M2 adds systems programming features, modular and incremental compilation, and a number of "programming in the large" features, but loses some of the concurrent features of the earlier Modula.

Modula-2 was hugely influential in the field of informatics and at the least 50 other languages have been based on it in addition to having a direct or indirect influence on languages like Basic, Java, C# and Object Pascal, amongst the more notable languages that are based on M2 are Modula 3, Parallaxis, Yafl, Oberon, Oberon-2, IEC61131, Umbriel, Component Pascal and Zonnon.

Modula-2 was more popular on the 68000 based computers than it was in the Intel world and for a time it was more popular for professional software development on that processor family than C, in particular on the Atari ST and single board systems where it was frequently used for server OS development. The reasons for this appear to be the quality of the tools available, ETH had a public domain Modula-2 compiler available that had an excellent 68000 and NS32000 backends, and a number of third parties took that compiler and enhanced it for a number of systems.

By the time the Intel 386 arrived on the scene Wirth had however lost interest in M2 and had started concentrating on Oberon so there never was an equivalent PD release of the ETH M2 compiler for that architecture for smaller firms to build on, but toolkits nonetheless crop up in the unlikeliest of places, IBM for instance had an OS/2 hosted compiler that is believed to have originated on their RT 68000 system (IBM System 9000), that was used to develop parts of the original AS/400 operating system (Probably parts of the I/O system). Note that this was not related to the later OS/2 based IBM Oberon-2 system that was an independent development.

OS/2 implementations

  • IBM Modula-2 - Internal use only, never released - Used for cross development of portions of the OS/400

16-bit

32-bit

Libraries

Open Source

Commercial

Unfinished projects
  • Net Modula2
  • Modula-2 Algebra System (MAS) - Open source
Editors support

DOS implementations

Libraries
Editor support
  • Boxer - Modula-2 syntax colouring support included by default
  • BRIEF - M2 support included by default

Java implementations

Publications

Articles
Tutorials and other learning material
Reviews
  • D. Taylor: Software Reviews: Metrowerks Modula-2 PSE - Computer Language (Nov 1990) - pp 91-95
  • B. R. Anderson: Stony Brook Modula-2 - Journal of Pascal, Ada & Modula-2 (May/Jun 1990) - pp 69-73
  • S. R. Ladd: Modula-2 Compilers: New Kids on the Block Mature - Computer Language (Mar 1989) pp 99-110
Introductions

Links

USENET

Standards

There are five basic variations of the Modula 2 standard, the first four are simply the four editions of the book "Programming in Modula-2" by Niklaus Wirth and are commonly known as PIM1, PIM2 and so on, the fifth is an ISO standard called ISO 10514-1 that extends the language somewhat and in addition to the standard proper there have been some optional additions to it since it was originally submitted, but the additions are rarely implemented.

  • PIM1 Original from 1979, no compiler apart from the original ETH m-code compiler is known to have implemented this version.
  • PIM2 A few DOS, UCSD and CP/M compilers implemented this standard, although most DOS compilers got upgraded to PIM3.
  • PIM3 The third edition is by far the most popular amongst compiler makers, who by and large shun PIM4, biggest change is better support for multi-dimensional arrays.
  • PIM4 The fourth edition, very few compilers implement this variant but one notable exception is the native OS/2 compiler Canterbury Modula-2. An HTML version of Wirth's fourth edition of "Programming in Modula-2" is available here
  • ISO10514-1 ISO standard Modula 2, slightly controversial since it adds quite a bit to the language, but most modern compilers implement this version. Adds a standardised library.
  • ISO10514-2 Adds an OOP layer
  • ISO10514-3 Adds generics