GHCi and -O [was: Re: ANNOUNCE: GHC 5.02.3 released]

Till Doerges till@doerges.net
Tue, 9 Apr 2002 00:09:46 +0200


On Mon, Apr 08, 2002 at 01:13:13PM +0100, Simon Marlow wrote:

>    The (Interactive) Glasgow Haskell Compiler -- version 5.02.3

Nice. :-)

> NOTE: object files created by this vesrion of GHC may be incompatible
> with object files created by older versions of GHC, so be sure to
> recompile any pre-compiled libraries you may have lying around.

This made me think about using *.o-files in GHCi generated w/ 'ghc
-O2'. My GHCi (currently 5.00.2) states:

--- snip ---
warning: -O conflicts with --interactive; -O turned off.
--- snap ---

if I pass -O2 to ghci.

Additionally, I recall some core-dumps or having ghci sometimes report
missing symbols if using some modules compiled w/ optimization.

So, is GHCi supposed to work w/ optimized modules after all? The
documentation merely suggests, this might be possible:

--- snip --- 
Why should we want to run compiled code? Well, compiled code is
roughly 10x faster than interpreted code, but takes about 2x longer to
>produce (perhaps longer if optimisation is on). So it pays to compile
the parts of a program that aren't changing very often, and use the
interpreter for the code being actively developed.
--- snap ---

Thanks -- Till
-- 
     e-mail: reverse(net dot doerges at till)   | ENCRYPTED |
    pgp/gpg: keys via keyserver or my homepage  |  MAIL IS  |
        www: http://www.doerges.net             |  WELCOME! |