M2CC/C

From EDM2
Jump to: navigation, search

A Modula-2 to ANSI C compiler developed by Swiss company Glance in the late 80's and early 90's. It aims for compatibility with Logitech Modula-2 and was indeed initially developed with that system and the M2CC/C at the time only offered on host platforms that LM2 supported including DOS, OS/2, VMS and sundry DEC UNIX derivatives. Over time the company started to port to other system by using the M2CC/C tool itself as the development platform, initially it was ported to SCO XENIX and UNIX but later the company offered to port the tool to any reasonably POSIX compatible or UNIX like system on a custom order basis.

Note that this is a Modula-2 to C compiler and not a translator, so it is not intended to port your code to C but rather to use C as an intermediate language in cases where a Modula-2 compiler was not available or as in the case of some UNIX M2 compilers, so different from the classic PC Modula that you might as well port the code. The compiler puts out strict ANSI C with the aim being maximum portability similarly the supplied libraries are both quite flexible in regards to target operating system and use common interfaces universally available with common C compilers rather than system or compiler specific features, in addition you could use existing Logitech libraries if you wanted to target one of the host systems.

Background & history

Logitech Modula-2 was heavily used by Swiss industry and to a lesser degree the Austrian and German ones as well, this was particularly true in process control and automation. When Logitech dropped the Modula-2/X system in the midst of a beta program in early 1988 it was becoming clear that the company was more interested in selling mice than to develop the M2 compiler on new systems while at the same time the industry was interested in moving from old minicomputer architectures and onto microprocessor based systems especially designed for process control and much of the operating systems intended for these system were either UNIX derived systems like XENIX, UNIX work-a-likes, offered a userland similar to UNIX like real-time systems OS-9 and QNX or at the least offered POSIX subsystems like OS/2 and Microsoft Windows later did.

With it being cost prohibitive for a relatively small company to develop and maintain a large number of compatible back ends for multiple targets and choosing a smaller subset was a considerable risk since at the time a huge number of microprocessor architectures were vying for the automation market and choosing a small subset meant the company taking a bet on the future popularity of each ISA. But in the late 80's there were a number of such microprocessor architectures either already popular in the high end embedded market or targeting it, including AMD 29000, MIPS, IBM POWER, PA-RISC, Intel 960, National NS32032, Motorola 680x0, SPARC, Motorola 88000, Intel 80386 and sundry Hitachi & NEC platforms.

Glance however hit upon the idea of using C as an intermediate language, this is fairly common practice today but was quite novel at the time and the reasoning was simply that literally all of these systems came with some form of C compiler an in the case of a UNIX or UNIX like system they came with them for free anyway so by using C as an intermediate language the compiler could use existing LM2 code and target potentially every system on the market. This proved to be a fairly successful approach, by version 4.5 M2CC/C had become quite an accomplished tool and while development of it has been suspended it is still in use in 2016 although mostly being used to target Linux systems.

M2CC/C and OS/2

Most of the in-house development of the compiler was done by Glance on an OS/2 workstation using OS/2 1.3 and then cross compiled to VMS, DOS and DEC UNIX, this meant that the OS/2 executable was by far the most battle hardened and stablest of the available platforms. While the system was primarily intended for porting onto UNIX like system there was some development of OS/2 software with it and you could use either the Logitech or Glance supplied libraries for with most people using the Logitech libs, it was possible to develop for DOS as well although I gather that the support for DOS as a target was limited and DOS was primarily intended to be used as a host.

Initially at the least the only verified OS/2 C compiler that supported OS/2 as a target was Microsoft C and it was squarely aimed at 16 bit development, however a number of companies that were using 32 bit versions of OS/2 in process control situations, modified and/or recreated the Logitech libs for 32 bit development and ported their products to 32 bit versions of the operating system without too much hassle.

Versions

  • Last known version: 5.0
Prerequisites
  • OS/2 1.2 or higher, 1.3 or higher recommended.

License and availability

  • Stabilised or discontinued commercial software. Retail price was SFr. 1500 for the DOS version, 1800 for the OS/2 one, the VMS, SCO UNIX/XENIX and ULTRIX versions vent for SFr. 2,500 but allowed two users of the system unlike the DOS and OS/2 version that only allowed one. Other ports were on custom order basis.
Note that the company behind the product is now known as Adesso Switzerland, and has been known to offer some service and even has sold some licenses to existing customers fairly recently, but no longer offers the tool as a product in their catalogue of services or on their webpage.

Publisher

  • Glance AG
Switzerland