Changes between Version 6 and Version 7 of ExplicitCallStack


Ignore:
Timestamp:
Nov 15, 2006 10:54:42 AM (7 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExplicitCallStack

    v6 v7  
    11= Maintaining an explicit call stack = 
    22 
    3 There has been a vigorous thread on error attribution ("I get a `head []` error; but who called `head`?").  This page summarises some half baked ideas that Simon and I have been discussing. Do by all means edit this page to add comments and further ideas or pointers.  (As usual, ''discussion'' is best done by email; but this could be a place to record ideas, design alternatives, list pros and cons etc.) 
     3There has been a vigorous thread on error attribution ("I get a `head []` error; but who called `head`?").  This page summarises some half baked ideas that Simon and I have been discussing. Do by all means edit this page to add comments and further ideas or pointers.  (As usual, ''discussion'' is best done by email; but this page could be a place to record ideas, design alternatives, list pros and cons etc.) 
    44 
    55See also 
     
    36364.  In fact, it's very similar to the "cost-centre stack" that GHC builds for profiling, except that it's explicit rather than implicit.  (Which is good.   Of course the stack should be a proper data type, not a String.) 
    3737 
    38 However, unlike GHC's profiling stuff, it is *selective*.  You can choose to annotate just one function, or 10, or all.  If call an annotated function from an unannotated one, you get only the information that it was called from the unannotated one: 
     38However, unlike GHC's profiling stuff, it is ''selective''.  You can choose to annotate just one function, or 10, or all.  If call an annotated function from an unannotated one, you get only the information that it was called from the unannotated one: 
    3939{{{ 
    4040        foo :: [Int] -> Int   -- No SRCLOC_ANNOTATE 
     
    5151Lots of open questions 
    5252 
    53  * It would be great to use the exact same stack value for profiling.  Not so easy...for exmaple, time profiling uses sampling based on timer interrupts that expect to find the current cost centre stack in a particular register.  But a big pay-off; instead of having magic rules in GHC to handle SCC annotations, we could throw the full might of the Simplifier at it. 
     53 * It would be great to use the exact same stack value for profiling.  Not so easy...for example, time profiling uses sampling based on timer interrupts that expect to find the current cost centre stack in a particular register.  But a big pay-off; instead of having magic rules in GHC to handle SCC annotations, we could throw the full might of the Simplifier at it. 
    5454   
    5555 * CAFs are a nightmare.  Here's a nasty case: