Skip to content
Benjamin Kowarsch edited this page Jun 5, 2023 · 6 revisions

M2Sharp Modula-2 Compiler & Translator Project

Welcome to the Wiki of the M2Sharp Modula-2 Compiler & Translator Project

Objective

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.

Purpose

The intended purpose for the M2Sharp compiler is to provide a means:

  • to compile, build and deploy a CLR hosted compiler for the BSK subset of Modula-2 R10.
  • to develop and bootstrap a self-hosting compiler for the full Modula-2 R10 specification targeting the CLR.

Language

M2Sharp shall support the bootstrap kernel subset of the revised Modula-2 language described in "Modula-2 Revision 2010" (Kowarsch and Sutcliffe, July 2020). For details, see the online language specification at the project wiki or download the PDF version. Please note that M2Sharp will support only the foreign function interface to C#. The C and JVM FFIs also described in the specification are specific to M2C and M2J respectively, and will not be supported by M2Sharp.

The earlier PIM and ISO dialects will not be supported.

Grammar

The grammar of the compiler is in the project repository

https://github.com/m2sf/m2sharp/blob/master/m2c-grammar.gll

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

License

The M2Sharp compiler is licensed under the GNU Lesser General Public License (LGPL) both v.2.1 and v.3.

Prerequisites

The M2Sharp compiler is written in C# and therefore a C# compiler is required to build it.

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.

M2Sharp's filesystem and pathname libraries support the following operating systems:

  • AmigaOS
  • DOS, Windows
  • POSIX, Unix
  • VAX/VMS, OpenVMS

For other systems, filesystem access and pathname parsing libraries may have to be adapted.

IDE support

M2Sharp has been integrated with Vim.

Status

This project is under active development (May 2023).

Contact

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

+++