Modula-2 compilers for OS/2

This is an overview of all (as far as I know) available Modula-2 compilers for OS/2. I don't have time to keep up with the latest version of everything, so I'd welcome feedback from anyone who can fill in any of the gaps. Added later (22 March 2010): it appears that all of the products mentioned here, apart from XDS Modula-2, are now obsolete. The XDS product is also obsolete according to its makers, but that's only because they have moved to supporting a more primitive language called Java. You can still find high-quality XDS compilers if you are prepared to search.

There's no significance to the order, except that it's alphabetical.

Canterbury Modula-2

Juergen Neuhoff's Modula-2 compiler.

Price: $US99, with discounts for multiple licences.

Remark: My comments below are based on an earlier beta release. Since that time the compiler has gone commercial. Details including ordering information can be found at www.webcom.com/mhc/welcome.html (broken link). I haven't tried out the newer version.

The public beta is apparently still available from the usual OS/2 archive sites (dev32/mod201j.zip). I don't know whether it's still current.

Language: PIM-4 with extensions. Some of the extensions appear to conform with the ISO Modula-2 standard, but some do not. Some features of the base language appear to differ from both PIM and ISO.

Object-oriented support: Oberon style, including SOM support.

IDE: Based on Mr Ed (a shareware editor).

Libraries:

Initial impression: I got a "Hello world" program working with no trouble, but I suspect that with this compiler I'd run into a lot of frustration on bigger projects, because of the poor user interface. My feeling is that this product still needs a fair bit of development work before it's ready to market.

Warning: if you install the beta version, you'll end up with two separate PATH statements in your CONFIG.SYS. To avoid trouble in future, you should immediately fix the error in CONFIG.SYS.

GPM

Gardens Point Modula-2.

The strong point of the GPM compilers is their support for ISO Modula-2; I presume this applies also to the OS/2 version.

Availability: anonymous ftp at ftp.fit.qut.edu.au (broken link). This is a commercial product, but is available free for evaluation or educational purposes.

First impressions: the compiler has rather a "Unix" look to it, so I haven't yet worked up the courage to try it out.

H2D

This isn't a compiler, but I include it here because it will be of interest to many Modula-2 programmers. It's a utility to translate C header files into Modula-2 definition modules.

H2D is available free from the XDS site.

TopSpeed

Originally JPI TopSpeed. Subsequently taken over by Clarion, but then Clarion changed its name to TopSpeed.

TopSpeed 3.1 is arguably still the best available compiler for the DOS environment, but the OS/2 version is considerably weaker. It was written for OS/2 version 1.3, and has never been upgraded, so there's no support for many of the features of more modern releases of OS/2. For text-mode applications it's OK, but then for text-mode applications you might as well use the DOS version.

There's apparently a new version as part of Clarion for Windows, but I haven't seen it, so the following information is unconfirmed. As far as I know, the new version is available only if you purchase Clarion as well, which is an unsatisfactory solution for those of us who have no need for Clarion. I don't have the faintest idea how well Clarion runs under OS/2, or indeed whether it runs at all.

XDS

From xTech: a compiler running on many platforms, including OS/2.

Availability: see details on the XDS home page (Russia) or the PMI page (USA, broken link). Demo versions and manuals are available at ftp.dct.com (USA, apparently empty directory) or ftp.iis.nsk.su (Russia, broken link). There's a status summary (reported bugs, enhancement proposals, etc.) at www.iis.nsk.su/xtech/xds/xdsfback.html (broken link). The current OS/2 demo version, version 2.21, is a slightly crippled version of the full commercial release. It looks as if updated demos are due to appear soon. (The Windows version is already up to a higher version number.)

There are two separate OS/2 packages: one that's been out for some time, and which uses C as its "machine language"; and a newer "Native Code" version. The version I'm reviewing here is the native code version. (But I've tried the Windows version of XDS-C, and can report that the C code it generates is superior in both readability and efficiency to the code manually generated by C programmers. Its only real fault - but unfortunately it's a serious fault - is that it deletes all comments.)

Price: Approximately $US300, with discounts for things like site licences.

Language: the compiler supports two languages: Oberon-2 and ISO Modula-2. There are also some hooks for multi-language projects, provided that you have the appropriate compilers from other suppliers (e.g. interfacing to Watcom C code is supported).

IDE: Yes, and it works quite well.

Libraries:

Debugger: not yet provided, but there's support for third-party debuggers. A new debugger, now undergoing beta testing, is available to registered users.

Speed: excellent. I haven't tested this in detail since several versions ago, but the XDS ftp site contains some benchmark programs for those who want to check for themselves.

Ease of use: there's a bit of an initial learning curve in terms of understanding the project system, but apart from that it's very user-friendly.

Overall impression: I've now tried several test projects with XDS, and it's working well for me. A few minor bugs have surfaced, but the developers are very responsive in fixing problems. It's very clearly the best of all the compilers mentioned on this page.

Given the present state of play in the DOS world, there's a good chance that xTech will pick up many of the ex-TopSpeed customers. (Obsolete comment. It appears that they tried to pick up the C programmers instead.)


Glossary

This section explains some terms used in the above descriptions.
API
Application Programmer Interface: in Modula-2 terms, this simply means the DEF files that let you call system functions.
EPM
The OS/2 Enhanced Editor (as distinct from the crude OS/2 System Editor).
IDE
Integrated Development Environment: roughly, this means a combined editor/compiler/linker/debugger package. For reasonable support of Modula-2, an IDE should provide at least the following:
ISO Modula-2
The latest standard for the Modula-2 language, as defined by the Modula-2 Working Group. This supersedes the earlier PIM pseudo-standard.
PIM
Wirth's book "Programming in Modula-2". Prior to the publication of a formal language standard, this was the de-facto standard used by most compiler developers. Several editions of the book have appeared; most of the older compilers comply with the PIM-3 version, i.e. the 3rd edition. (There is also a PIM-4, but it's generally felt to be inferior to PIM-3.)
SOM
System Object Model: A software specification for making use of the object-oriented features of OS/2. You don't need SOM support for simple text-mode applications, but you do need it if you want your program to take full advantage of the operating system features.

Feedback from other people

(From Graham Stark. I've edited his comments slightly to save space, but I think I've kept the spirit of what he's said. Some of his comments about the "beta" version are now obsolete; better versions have appeared.)

XDS and GPM M2 compilers are both 32-bit, and both are based on the ISO standard. XDS seems based on a later draft. There are minor differences in the libraries (mainly just in the names of functions and enumerated types) which mean that it takes a wee bit of work to port from one to the other. Both are also available on many other platforms, including 32-bit Windows, various Unixes and VMS.

GPM is a straight port of a Unix product. Under OS/2, it relies on the (freeware) EMX system for run time support. If you have other Unix ports then you probably already have EMX; if not, it's easy to obtain and install.

GPM doesn't come with any kind of "front end" but, with some work, it can be made to work very well with IBM's Workframe/2, if you have access to this.

XDS is Russian. There are two versions: a native code version, currently in Beta, and a M2-> C translator. The native code version is impressive, but still a wee bit buggy. We've mainly used the C translator version. Again, this is not as bad as it sounds, because you can configure the compiler to invoke the C compiler transparently. The only problem I'm aware of with XDS->C is that is sometimes doesn't like ISO-style structured constants, though I know they are working on this. Apart from this, I like it a lot: it's very fast, the error messages are particularly good, and it's quite TopSpeed-like, which should make it easy for our people to learn.

Both versions have a rather TopSpeed-like system of project and redirection files, although the project options are much more comprehensive than TopSpeed's.

The Beta native version has a simple editing/development environment (also available for Win95). I haven't tried these to any great extent. Again, it integrates very well with IBM Workframe/2.

It's worth pointing out that moving from TopSpeed (or PIM) M2 to ISO M2 is not a barrel of laughs regardless of which compiler you go for (but probably worth it in the end - at least I hope it is, having just done it..).


Back to the Top || Modula-2 page || OS/2 page
This information was compiled by Peter Moylan.
Last modified: 22 March, 2010