Skip to content
trijezdciPublic

About

MOCKA Modula-2 Compiler System, originally by GMD

Topics

Resources

Stars

25 stars

Watchers

4 watching

Forks

Latest commit

 

History

238 Commits

Folders and files

Repository files navigation

MOCKA

MOCKA Modula-2 Compiler System, originally by GMD

Follows the 3rd edition of Wirth's Programming in Modula-2, aka PIM3 [1, 2]

Historic Background

The MOCKA Modula-2 compiler was developed between 1988 and 1992 by the former German National Research Centre for Computer Science (GMD) [3] at its former research lab at the University of Karlsruhe [4]. GMD has since been dissolved. All its research institutes were merged into and all its assets transferred to Fraunhofer Society.

GMD followed a dual-licensing approach:

  • MOCKA compilers for commercial Unix platforms and architectures were sold as closed source commercial software and included industrial strength optimisation through AST transformations prior to code-generation*.
  • The Linux and BSD version of MOCKA with a backend for the 32-bit Intel x86 architecture but without optimisation was released open-source under GPL licensing free of charge.

In this Repository

The software in this repository is a derivative of the aforementioned open-source version.

Target Architecture

  • Intel x86 32-bit
  • generates AT&T syntax assembly output

Operating System Support

  • Linux and BSD with ELF executable and linkable format

Language Extensions

  • Conditional compilation
  • Lowline _ in identifiers
  • Types BYTE and LONGCARD
  • FOREIGN DEFINITION MODULE for interfacing to C

Last Release

For version change log, see CHANGES

Release History

  • last maintenance release 0605 from Uni Karlsruhe in May 2006
  • minor release 1208 by Chr. Maurer in August 2012, based on 0605
  • clean-up release 1807 by B.Kowarsch in July 2018, based on 1208

Status

In its current form, MOCKA is no longer supported and will not be further maintained.

Where do we go from here?

MOCKA's backend was generated by a proprietary backend generator. This backend only supports the 32-bit Intel x86 architecture and the front-end was designed to map to a 32-bit IR. In order to support any modern 64-bit architecture, a large part of the front-end would need to be rewritten, a new 64-bit IR would need to be designed and a new backend generated. This would take considerable time and effort, only to result in a compiler for legacy code that is written in an outdated dialect of Modula-2. The outcome would not justify the effort.

MOCKA on 64-bit

Any major effort should instead be directed at implementing the revised and modernised Modula-2 R10 dialect. This would require a rewrite based on the existing M2C front-end for Modula-2 R10, the development of two new backends, one each for AMD64 and ARM64, to be generated with BEG, and the integration of the front-end with these backends. Whilst highly desirable, this will require funding. We are currently in the process of preparing grant applications at several funding agencies and foundations that support such projects.

If and when funding has been obtained, the current code base in this repository will be moved to a legacy repository and archived, and this repository will then become the home of a new MOCKA64 project. Until then keep your fingers crossed, thumbs pressed, knock on wood!

Legacy Modula-2 Code

In order to compile and run example code from the Modula-2 literature on modern 64-bit platforms, or to migrate any remaining legacy Modula-2 code, it is entirely sufficient to use migration tools such as the Mtc2 Modula-2 to C89 Translator. With some adjustments, legacy code written for MOCKA could also be compiled using GNU Modula-2 with compiler option --fpim3. Other migration tools are being pursued such as the M2-Redux Syntax Reducer and the MOTTO Reduced-PIM Modula-2 to C99 Translator projects.

Backwards Compatibility

Backwards compatibility is the mother of all evil in software. There will be no backwards compatibility! Use a legacy tool.


Footnotes

[*] The BEG backend generator used to generate backends for MOCKA does not perform any optimisations.


References

[1] Wikipedia entry on the Modula-2 programming language

[2] Programming in Modula-2, 3rd edition, N.Wirth, Springer, 1988

[3] Google translation of Wikipedia entry on the former GMD

[4] Former MOCKA project page at University of Karlsruhe


The Modula-2 Webring

All Sites | Previous Site | Next Site | Random Site | Join the Webring

[END OF FILE]

About

MOCKA Modula-2 Compiler System, originally by GMD

Topics

Resources

Stars

25 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages