| Version 3 (modified by dterei, 3 years ago) |
|---|
GHC Commentary: Backends
After Cmm has been generated, we have a choice of targets to compile to:
- The C code generator
- The native code generator
- The LLVM code generator
- Future: a C-- code generator
These backends are completely interchangeable. Our preferred route is the native code generator, because the C code generator relies on some serious hackery, namely the Evil Mangler, to get fast tail-calls and other performance tricks. The Evil Mangler is slated for removal as soon as possible, which would leave us with just the native code generator for optimised compilation, and the C code generator for portable, non-optimised, or unregisterised compilation.
It is likely that only the native code generator will be able to generate position independent code (PIC) which is necessary for dynamic libraries, so once we're doing this the C code generator will be even more deprecated.
