Modula 2

I am still a fan of Wirth's small neat language called Modula 2 which was briefly popular in the mid 80's.
It is an elegant strongly typed language which deserved to be more successful. The world decided to go another way entirely and went for the very weakly typed C and then for C++ which is a distinct improvement. I still use Modula 2 from time to time (mainly maintenance work for clients) and here are some tools and links to other M2 regulars.


I visited ETH Zurich, the original home of Niklaus Wirth the inventor of Modula 2 and also of the hardware implementation Lilith designed to run it. The machines are in a small museum case in the computer laboratory. There is a first generation half wooded model with what look like S100 style cards and a much sleeker second generation box that once ran an early version of PCB layout software for Lilith hardware with which it had been designed.

There is some more information about Lilith and ETH developments of Modula 2 online at

I have to confess that these days I mostly program in C++ for commercial reasons.

Here a a couple of utilities which may be of interest.

Modula 2 CCI

This program computes McCabes Cyclomatic Complexity Index and other simple metrics for Modula 2 routines which are useful for quickly identifying likely troublespots in inherited legacy code. I have found the CCI to be a very good guide to routines which are too complex and are therefore likely to harbour bugs.


This program computes the bytewise entropy of a file and a few other statistics for unused and most frequently occurring byte codes which provides a crude measure of the file's residual compressibility.

I plan to add a few more code snippets of particular interest to users of JPI/Topspeed Modula 2 and especially the handful who still use the OS/2 version of the compiler. These are offered as unsupported downloads that might be of interest to other users of this (slightly odd) dialect of Modula 2.

JPI/Topspeed Unofficial Support Page

Links to other interesting sites for Modula 2

Excelsior XDS Modula 2 (now a free download)

And actually quite a good optimising compiler. It also has a Topspeed compatibility pack which makes recompiling old Topspeed code somewhat less painful. Various pragmas are needed to obtain maximum TS M2 dialect compatibility. The compiler also does a fair amount of static analysis and finds obscure bugs on rarely traversed paths in old legacy code. It is quite a handy compiler if you have legacy Topspeed and/or Logitech Modula 2 code that needs recompiling for a modern platform.

Some other general links on Modula 2

comp.lang.modula2 FAQ
Peter Moylan's Modula 2 page
Pat Terry's  Modula 2 and friends page
Static analysis for Modula 2 (unfortunately this resource has vanished - link is to wayback machine)
Modula 2 on Wikipedia
BURKS Modula2 resources

Email to Martin Brown

Send feedback suggestions and comments to Martin Brown
Last modified 16th July 2013