Hacker News new | past | comments | ask | show | jobs | submit login

GHC compiles haskell through about a million different IRs and abstract machines, until eventually reaching Cmm, which is effectively a similar idea to LLVM IR (A very simple C ish imperative language). Any benefits to be had, should be fairly straightforward for the GHC folks to use, which should be cool.



It's just Core, STG, Cmm. Anything else I'm missing?


I wasn't trying to be critical, it's just significantly more than most languages (With good reason!). This is a good thing, I dream of when we will have libraries/frameworks for doing these kind of high level program transformations in a modular way a la LLVM.


No. But that is probably two more than most other languages with a similar compilation model. (I think Rust has two IRs?)


Just for some more data, Swift is (Possibly still in the process of, but I don't follow swift so they could have finished years ago) moving to a higher level IR, for similar reasons to Rust and Haskell.


I thought Swift had multiple levels of SIL inside the compiler.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: