Guide to Core/STG syntax?

Nicholas Nethercote
Tue, 6 Nov 2001 15:39:59 +0000 (GMT)


I'm trying to come to grips with GHC, and one thing that I think would
help would be a nice guide to the Core and STG syntaxes.  There is an old
guide to Core syntax in the user guide (section 4.17.3) but that section
remains unchanged from at least version 0.29 of the compiler, and is
looking rather out of date.

"Implementing lazy functional languages on stock hardware: the spineless
tagless G-machine" has a good overview of the STG language, but it too is
out of date and/or simplified.

The document fptools/ghc/docs/rts/rts.tex has a section for STG syntax,
but it's empty and marked with "ToDo".

The syntax spat out by GHC at various stages when -v4 is enabled seems to
vary somewhat, and it's also slightly different to that emitted to
.hcr files when the -fext-core option is on, all of which makes things a
bit confusing.

Does anyone know where I can find up-to-date information about these
intermediate representations?

Nick Nethercote