... | ... | @@ -4,7 +4,7 @@ |
|
|
There has been a vigorous thread on error attribution ("I get a `head []` error; but who called `head`?"). This page summarises various approaches.
|
|
|
|
|
|
|
|
|
Relevant tickets: [\#960](https://gitlab.haskell.org//ghc/ghc/issues/960), [\#1441](https://gitlab.haskell.org//ghc/ghc/issues/1441), [\#3693](https://gitlab.haskell.org//ghc/ghc/issues/3693), [\#9049](https://gitlab.haskell.org//ghc/ghc/issues/9049), [\#10656](https://gitlab.haskell.org//ghc/ghc/issues/10656)
|
|
|
Relevant tickets: [\#960](https://gitlab.haskell.org/ghc/ghc/issues/960), [\#1441](https://gitlab.haskell.org/ghc/ghc/issues/1441), [\#3693](https://gitlab.haskell.org/ghc/ghc/issues/3693), [\#9049](https://gitlab.haskell.org/ghc/ghc/issues/9049), [\#10656](https://gitlab.haskell.org/ghc/ghc/issues/10656)
|
|
|
|
|
|
## Approaches
|
|
|
|
... | ... | @@ -18,7 +18,7 @@ Here are the approaches we have under consideration |
|
|
|
|
|
>
|
|
|
>
|
|
|
> then any crash (call to `error`) will yield an informative backtrace. The backtrace gives you a stack of calls that looks very like what you'd get in a call-by-value language. (Lots of papers about profiling in a lazy language, dating right back to [ Formally based profiling for higher order functional languages](http://research.microsoft.com/~simonpj/papers/1997_profiling_TOPLAS.ps.gz) give the background.)
|
|
|
> then any crash (call to `error`) will yield an informative backtrace. The backtrace gives you a stack of calls that looks very like what you'd get in a call-by-value language. (Lots of papers about profiling in a lazy language, dating right back to [Formally based profiling for higher order functional languages](http://research.microsoft.com/~simonpj/papers/1997_profiling_TOPLAS.ps.gz) give the background.)
|
|
|
>
|
|
|
>
|
|
|
|
... | ... | @@ -44,18 +44,18 @@ Here are the approaches we have under consideration |
|
|
|
|
|
>
|
|
|
>
|
|
|
> Addressing these challenges is the subject of Peter Wortman's PhD. He has a paper [ Causality of Optimized Haskell: What is burning our cycles?](http://eprints.whiterose.ac.uk/77401/), and an implementation is well advanced (in GHC 7.10).
|
|
|
> Addressing these challenges is the subject of Peter Wortman's PhD. He has a paper [Causality of Optimized Haskell: What is burning our cycles?](http://eprints.whiterose.ac.uk/77401/), and an implementation is well advanced (in GHC 7.10).
|
|
|
>
|
|
|
>
|
|
|
|
|
|
- **(IMPLICIT)** Implicit locations. An extremely simple idea is to use implicit parameters to pass location information: [ExplicitCallStack/ImplicitLocations](explicit-call-stack/implicit-locations). This capability is available already in GHC using `CallStack` from `GHC.Stack` see [ http://hackage.haskell.org/package/base/docs/GHC-Stack.html](http://hackage.haskell.org/package/base/docs/GHC-Stack.html)
|
|
|
- **(IMPLICIT)** Implicit locations. An extremely simple idea is to use implicit parameters to pass location information: [ExplicitCallStack/ImplicitLocations](explicit-call-stack/implicit-locations). This capability is available already in GHC using `CallStack` from `GHC.Stack` see [http://hackage.haskell.org/package/base/docs/GHC-Stack.html](http://hackage.haskell.org/package/base/docs/GHC-Stack.html)
|
|
|
|
|
|
- **(NEEDLE) Finding the needle**. This is a cross between (PROF) and (DYN). It transforms the program, but in a less invasive way than for full profiling. Lots more details on [ExplicitCallStack/FindingTheNeedle](explicit-call-stack/finding-the-needle). We don't currently plan to implement this in HEAD: it is not clear that, given (PROF) and (DYN), it's worth a third path, and one that is non-trivial to implement (as you'll see from the paper).
|
|
|
|
|
|
## Other relevant writings
|
|
|
|
|
|
- [ Simon Hengel's "rewrite with location" proposal](https://github.com/sol/rewrite-with-location), see also [ Michael Snoyman's post](http://www.haskell.org/pipermail/haskell-cafe/2013-February/106617.html). The current `CallStack` support in GHC.Stack is morally similar to this proposal, although instead of a pragma, implicit parameters are used to pass the information through.
|
|
|
- [ Lennart Augustsson's post](http://augustss.blogspot.se/2014/04/haskell-error-reporting-with-locations_5.html)
|
|
|
- [ The Haskell cafe thread](http://www.haskell.org/pipermail/haskell-cafe/2006-November/019549.html)
|
|
|
- [ http://www.cse.unsw.edu.au/\~dons/loch.html](http://www.cse.unsw.edu.au/~dons/loch.html)
|
|
|
- [ HAT](http://haskell.org/hat) |
|
|
- [Simon Hengel's "rewrite with location" proposal](https://github.com/sol/rewrite-with-location), see also [ Michael Snoyman's post](http://www.haskell.org/pipermail/haskell-cafe/2013-February/106617.html). The current `CallStack` support in GHC.Stack is morally similar to this proposal, although instead of a pragma, implicit parameters are used to pass the information through.
|
|
|
- [Lennart Augustsson's post](http://augustss.blogspot.se/2014/04/haskell-error-reporting-with-locations_5.html)
|
|
|
- [The Haskell cafe thread](http://www.haskell.org/pipermail/haskell-cafe/2006-November/019549.html)
|
|
|
- [http://www.cse.unsw.edu.au/\~dons/loch.html](http://www.cse.unsw.edu.au/~dons/loch.html)
|
|
|
- [HAT](http://haskell.org/hat) |