| I'm trying to compile a module that looks like this:
| 
| ---begin
| module PLib where
| import Common
| gr_lib = <the most collosal constant in the world, ever>
| ---end
| 
| GHC comes up with:
| 
| "PLib.hs", line 3, column 476908: parser stack overflow on input: ""i""

This is fixed in 2.02 (available later today or early tomorrow).  I guess
gr_lib is a list; the parser now parses lists right-recursively to avoid
stack overflow.

You can fix it in 0.29 by recompiling the parser with a bigger stack...

| In fact, I've just tried compiling a similar module whose line 3 is a meagre
| 146790 columns, with options -H50M -K20M. After just under 6 minutes, it
| reports "GHC's heap exhausted; while trying to allocate 12 bytes in a <very
| big> heap".

This is harder to fix.  A huge input program simply gives the main compiler
indigestion; it's just not designed for it.  I don't think there's much you
can do.

Getting fast "binary" I/O of large structures is something which would be
really nice --- people often ask for it.  Any volunteers?

Simon

Reply via email to