4 ms·
> I love using Haskell, but have no idea what kind of machine code GHC spits out at the end There is GHC's core, an indermediate representation of your code (m
by ReleaseCandidat 3y ago
> I love using Haskell, but have no idea what kind of machine code GHC spits out at the end
There is GHC's core, an indermediate representation of your code (mostly "just" desugared Haskell), which is comparable to Andreas' C++ Insights. Which you can get by passing `-ddump-simpl` with additional flags to disable displaying everything.
A list of other internal GHC data to dump is https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/options-debugging.html https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_gui...
But getting an idea what assembly is finally generated is still hard (at least for mé). Or, to rephrase, to know if "everything" is finally unpacked and strict or not, and if not: why not.
Btw. IMHO still the best book to read (of course not up-to-date, but to get the basic concepts of GHC) is https://www.microsoft.com/en-us/research/publication/the-implementation-of-functional-programming-languages-2/ https://www.microsoft.com/en-us/research/publication/the-imp...
https://www.microsoft.com/en-us/research/uploads/prod/1987/01/slpj-book-1987-r90.pdf https://www.microsoft.com/en-us/research/uploads/prod/1987/0...