static constants -- ideas?

Simon Peyton-Jones simonpj at microsoft.com
Mon Feb 25 06:24:30 EST 2008


|   On another note, I am extremely curious about the difference
|   between statically compiling a list and building it at
|   runtime. I find it hard to wrap my head around the fact that I
|   can build the list at runtime in a short time, but can not
|   compile it without eating all of my machine's RAM.

It's not quite as stupid as it sounds.  The run-time version is like an *interpreter*: you write an interpreter (a parser in fact) that interprets the byte-strings you read from disk, and builds in-heap data.

The compile time version is, well, a compiler, and generates statically-allocated data. This may be a lot bigger than the interpreter, of course, and it all has to be stuffed through all the compiler phases.  That should certainly be possible, but it's just something that GHC is not well optimised for.  We are actively working on the more egregious manifestations thought: see http://hackage.haskell.org/trac/ghc/ticket/2002.

Anyway, have another go when you see that #2002 is fixed.

Simon


More information about the Glasgow-haskell-users mailing list