The MOSA Compiler Framework is agnostic to the source of its intermediate representation. The compiler framework should be able to handle various sources of its code, such as .NET CIL, Java byte code or other P-Code Machine.
.NET CIL compilation related stages¶
Compiling CIL with the compiler framework requires the first five stages of the compilation pipeline to be:
- CIL Decoding Stage
- Basic Block Builder Stage
- Exception Prologue Stage
- Operand Assignment Stage
- CIL Transformation Stage
These stages read the CIL instructions, transform the linear instruction stream into one based on basic blocks, insert exception opcodes, determine the instruction operands, and transform CIL into a high level-IR (intermediate representation), which is closer to a real machine than the high level CIL opcodes.
Java byte code compilation stages¶
Right now there's no compiler frontend related to compiling Java byte code. If you want to start developing one, contact the MOSA compiler team for support and coordination.
Other source languages¶
Technically the compilation framework should handle any source language, which is not translated into native machine code. It should even be possible to compile directly from source code to native code with the appropriate compilation stages, which do source code parsing and the other stages required to transform source code into the intermediate representation of the MOSA compiler framework.