As part of the GHC, there is the step of translating the Haskell source code to Core and then (not necessarily as the next next step), translating Core to STG. However, one problem avoids me from my understanding - when do we have βnormalβ code (ie. Like plain text) and when something really lives in memory, for example, abstract syntax trees (AST)?
And to clarify my question, I will divide it into parts:
1) when analyzing the phase of the Haskell source file, do we immediately create an AST for the Core language? If not, then it seems to me that we need to build an AST of a full Haskell (which seems strange), and then either convert them to ASTs Core, or, firstly, into a textual representation of them in Core and parse again to get Core AST .
2) almost the same question relates to the transition of Core to STG (but in this case, I think I can assume that we have Core ASTs - right?)
source share