C Frontend - Lambda-Mountain-Compiler-Backend/lambda-mountain GitHub Wiki
LM now accepts C code to compile.
Principle of Unchanged
The C Frontend for LM can optionally emit C code as a target. In this case, the C code should be unchanged from the original source file.
LM does not handle preprocessing, so C code is only compared to original source after preprocessing has taken place. Whitespace may be added or removed. Source location information may be added (this can be disabled). Nonstandard behavior may cause changes to the output code.
Aside from these exceptions, the output C files should be byte identical to the original input. If you see an exception to this rule, please file a bug report.
Nonstandard Behavior
We try to conform to ANSI C standards but there are some places where interoperability with other LM code yields some non-standard behavior.
- Generated C code attempts to be compliant with older versions of C standards (i.e. C99 if possible)
- this creates possible diversions from the "principle of unchanged"
- C Code can call out to other LM functions
- C Code that calls LM functions can potentially use "punned" symbols which need to be mangled