Compiler Frontends¶
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:
- Decoding Stage
- Basic Block Builder Stage
- Exception Prologue Stage
- Operand Determination Stage
- CIL Transformation Stage
These stages decode of CIL code into an CIL intermediate representation, transform the linear instruction stream into one based on basic blocks, inserts exception opcodes, determines the operands, transform the high-level CIL opcodes into a lower level IR 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.