|Version 4 (modified by dterei, 5 years ago) (diff)|
GHC Commentary: Backends
After Cmm has been generated, we have a choice of targets to compile to:
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.