by codeflo · 4y ago · 0 comments
I actually researched this some time ago, and was a bit surprised to learn that modern GHC’s intermediate representation seems to differ from what the C-- paper describes quite substantially, in ways that are only described in the source code. They’re still using the same name though.
One observation is that GHC has been somewhat slow to adopt new CPU targets (M1, WebAssembly). I wonder if the reliance on C-- played a role in that.
https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_gui...
C-- - Initial release: 1997
> it’s interesting they chose to implement their own intermediate language, as opposed to just sticking to LLVM IR and “outsourcing” the problem of code generation
I was not replying to:
> It’s still interesting that they’ve stuck to it for 20 years after LLVM’s release.
Changing the backend from their own IL to LLVM IR several years later is not exactly a "just sticking to LLVM IR" story. Knowing that C-- predates LLVM explains why they chose to implement their own IL.