[Haskell-cafe] ghc-heap-view now with recursive pretty-printing

Joachim Breitner mail at joachim-breitner.de
Tue Dec 25 19:09:15 CET 2012


Hi,

Am Dienstag, den 25.12.2012, 16:58 +0100 schrieb Thomas Schilling:
> On 21 December 2012 11:16, Joachim Breitner <mail at joachim-breitner.de> wrote:
> > Prelude> :script /home/jojo/.cabal/share/ghc-heap-view-0.4.0.0/ghci
> > Prelude> let x = [1..10]
> > Prelude> x
> > [1,2,3,4,5,6,7,8,9,10]
> > Prelude> :printHeap x
> > _bh [S# 1,S# 2,S# 3,S# 4,S# 5,S# 6,S# 7,S# 8,S# 9,S# 10]
> >
> > Note that the tools shows us that the list is a list of S# constructors,
> > and also that it is still hidden behind a blackhole. After running
> > System.Mem.performGC, this would disappear.
> 
> Why do you call it a "blackhole"?  I assume you mean a thunk that has
> been evaluated and updated with its value.  The commonly used term for
> this is "indirection".  A blackhole is used to detect when a thunk's
> value depends on itself (e.g., in "let x = id x in ..." the thunk for
> x may get turned into a black hole).

I don’t call it a blackhole, GHC does :-). At least it is a closure of
type BLACKHOLE
http://hackage.haskell.org/trac/ghc/browser/includes/rts/storage/ClosureTypes.h#L61

I assume this is due to lazy blackholing or something, although it still
occurs with "ghci -fno-eager-blackholing"... strange.


> It's a minor thing, but I think it's a good idea to stick to existing
> terminology. Otherwise, it looks like a useful tool.

Thanks!

> Eventually, we
> probably want an interactive graph where we can click a node to
> evaluate it (or to show/hide children nodes).

Looks like I am not as good at advertising my (or my student’s) projects
as much as I thought I am:
http://felsin9.de/nnis/ghc-vis/

Greetings,
Joachim





-- 
Joachim "nomeata" Breitner
  mail at joachim-breitner.de  |  nomeata at debian.org  |  GPG: 0x4743206C
  xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121225/696918b1/attachment.pgp>


More information about the Haskell-Cafe mailing list