[Haskell-cafe] Byte Histogram
andrewcoppin at btinternet.com
Sat Feb 5 16:40:58 CET 2011
On 04/02/2011 07:30 AM, Johan Tibell wrote:
> Right. It can still be tricky. I think we can get rid of a large
> number of strictness issues by using strict data structures more
> often, this should help beginners in particular. For the rest better
> tooling would help. For example, a lint tool that marked up code with
> the strictness information inferred by the compiler would be useful. I
> had time to write one I would make the output look like HPC html
> reports, with one color for strict function arguments and one color
> for lazy function arguments.
There's the RTS watch that makes it spit out heap profiling information.
However, determining what the hell this data actually means is well
beyond my powers of comprehension.
I keep hoping that eventually the mechanism used by ThreadScope will
eventually allow you to compile a program with profiling, run it, and
observe absolutely everything about its execution - how many cores it's
using, how much RAM is allocated to each generation, etc.
Then again, if you could actually single-step through a Haskell
program's execution, most strictness issues would become quite shallow.
Indeed, when I first learned Haskell, the very concept of lazyness ever
being "detrimental" was incomprehensible to me. I couldn't imagine why
you would ever want to turn it off. But then I built a simple program
that single-steps through Haskell(ish) expressions, and suddenly
discovered that foldl' needs to exist...
More information about the Haskell-Cafe