Questions about "time and space profiling for non-strict langs" paper and cost centre impl. of GHC

Peter Wortmann scpmw at leeds.ac.uk
Sun May 18 19:30:45 UTC 2014


> In Simon Marlow's slides, stack traces are implemented in terms of
> "call" and "push" operations. I guess `push` in STG syntax is stands
> for "push" operation explained in the slides but as far as I can see
> "call" is missing in generated STG.

There seems to be some confusion here - "push" is a language construct, whereas "call" is a function in Simon's language interpreter, just like "eval".

> What does "CCCS" stand for here?

Notice that it is an annotation on a constructor. It says what cost-centre stack to put the heap cost under, just like with lambdas. In your example the value is not statically allocated, therefore we put it into the "current cost-centre" instead of "don't care".

This might be a pretty obvious piece of information, but that's essentially what Stg is - prepared Core with lots of annotations to facilitate code generation. Try -ddump-prep if you want something more sensible to look at.

Greetings,
  Peter Wortmann


More information about the ghc-devs mailing list