= GHC Commentary: Backends =
After [wiki:Commentary/Compiler/CmmType Cmm] has been generated, we have a choice of targets to compile to:
* [wiki:Commentary/Compiler/Backends/PprC The C code generator]
* [wiki:Commentary/Compiler/Backends/NCG The native code generator]
* [wiki:Commentary/Compiler/Backends/LLVM The LLVM code generator]
* [wiki:Commentary/Compiler/Backends/GHCi The GHCi code generator]
These backends are completely interchangeable. Our preferred route is the native code generator. The C code generator is used for portable, non-optimised, or unregisterised compilation (Note that the LLVM backend also supports building GHC in unregisterised mode as well as registerised mode so it is usually the preferred route for porting GHC).