
15 Feb
2019
15 Feb
'19
7:30 a.m.
Hi all, I'm attempting to get the Stg for a module with the intention of interpreting it myself. Here is a self-contained GHC-8.4.3-specific test-case to get STG: https://gist.github.com/chrisdone/08ef9e8447b71c9dadc5bba949cda638#file-prin... I'm using the handy helpers GHC.parseModule, GHC.typecheckModule, GHC.desugarModule to get the Core. For getting the STG I copied what is done in HscMain.hs in GHC, right before it generates Cmm: https://github.com/ghc/ghc/blob/ghc-8.4/compiler/main/HscMain.hs#L1312-L1318 Can anyone confirm that the part I've highlighted in my Gist is the correct way to get Stg? I can't really tell whether I missed anything or did something wrong. Cheers!