Modula-3

Languages influencing Modula-3, starting with Algol 60

There’s a brand new project at the newly-refurbished Software Preservation Group website: the Modula-3 programming language. Modula-3 sounds like it would have been designed by Niklaus Wirth, but it was actually designed by a committee consisting of Luca Cardelli, Jim Donahue, Mick Jordan, Bill Kalsow, and Greg Nelson, and named Modula-3 with Wirth’s blessing.

The diagram above, drawn by Nelson, gives an idea of its heritage. Mesa, designed at Xerox PARC in the mid 1970s, borrowed many ideas from Pascal, but added modules (with interfaces called DEFINITIONS modules and a module configuration language), exceptions, and threads (called processes, but they shared a single address space). Wirth spent a sabbatical at PARC, and decided to add definition modules to Modula-2. Meanwhile, PARC’s Cedar project extended Mesa with storage safety (via garbage collection) and runtime type determination. Then a core of PARC researchers followed their director Bob Taylor to establish the System Research Center (SRC) at DEC. They couldn’t take Cedar with them (it was proprietary, and ran only on exotic Dorado workstations). Another DEC lab had implemented a Modula-2 compiler, which the SRC people extended with their favorite Cedar Mesa features (exceptions, threads, garbage collection, and runtime type determination), naming the result Modula-2+. The nearby Olivetti Research Center, with other former PARC researchers, adopted this new language too. Seeing the utility of this language, Maurice Wilkes, retired from Cambridge but consulting at DEC and Olivetti, suggested to Wirth that Modula-2+ be revised and standardized as Modula-3. Wirth approved and the committee got to work, ultimately adding two important features, object types and generics; even still, the Modula-3 Report came in at just over 50 pages.

The SRC implementation at first generated C. Later the compiler was restructured with an interface making it fairly easy to substitute different code generators; one that used the back-end of gcc allowed widespread portability. Modula-3 adoption began spreading, facilitated by ftp to distribute source code and email and the comp.lang.modula3 newsgroup to share ideas and experience.

Researchers at SRC switched fairly quickly from Modula-2+ to Modula-3: the former was tied to older hardware, whereas Modula-3’s portability allowed it to run on the latest DEC ALPHA workstations. Projects included window system toolkits, algorithm animation, distributed systems, experimental programming languages, two-view and constraint-based editors, new web browsing paradigms, and program verification. Many of these projects produced libraries that became building blocks for subsequent projects. Researchers at several universities also found it a good base for ambitious projects, including an extensible operating system and an augmented reality system. One small company attempted to commercialize the language. An open-source developer used it to create the system used for many years to distribute FreeBSD source code.

Then Java came along, offering similar features plus “write once, run anywhere”—that plus Sun Microsystem’s marketing effort quickly eclipsed Modula-3. Even at SRC, researchers switched from Modula-3 to Java.

SRC’s system had always been open source, and there were several forks, including the commercial company’s proprietary version (which was later open-sourced). Gradually the forks were merged into two alternative releases, CM3 and PM3, which are both hosted at https://github.com/modula3/. CM3 will run on most modern platforms. Documentation exists, but isn’t always easy to navigate.

My personal interest in Modula-3 began when I worked at SRC and helped develop some of the standard library interfaces and an application. I hope the language will be remembered—and used—for many years to come.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.