Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.

M2Sharp — A CLR hosted Modula-2 to C# Translator

Welcome to the M2Sharp Modula-2 to C# Translator and Compiler Project


The objective of this project is to develop a CLR hosted Modula-2 to C# translator and via-C# compiler that generates CLR executable code.

In translator mode, M2Sharp translates Modula-2 source to C# source files. In compiler mode, M2Sharp compiles Modula-2 source via C# source files to object code or executables using the host system's C# compiler.


M2Sharp supports the bootstrap kernel (BSK) subset of Modula-2 R10 (M2R10).

An online version of the language specification is here:

The authoritative language specification (PDF) is available for download:

M2C does not support the earlier PIM or ISO dialects.


The grammar of M2C's command line interface is in the project repository

The grammar of Modula-2 R10 is in the project repository

For a graphical representation of the grammar, see section Syntax Diagrams.


M2Sharp will generate C# sources compileable with any C# compiler.

There are no dependencies on any third party libraries.

OS support

M2Sharp will compile and run on any target system with a CLR execution environment.

Development Languages

  • M2Sharp itself is written in C#.
  • The syntax diagram generator script is written in TCL/TK (not required to build M2Sharp)
  • Build configuration scripts are written in the prevalent shell language of the hosting platform

Project Wiki

For more details please visit the project wiki at the URL:


If you have questions or would like to contribute to the project, get in touch via