Should GHC default to -O1 ?

Nathan Howell nathan.d.howell at
Wed Nov 9 10:58:23 CET 2011

On Tue, Nov 8, 2011 at 11:28 PM, <wagnerdm at> wrote:
> I don't agree that GHC's user interface should be optimized for newcomers
> to Haskell. GHC is an industrial-strength compiler with some very advanced
> features; the majority of its target audience is professional programmers.
> Let its interface reflect that fact.
> As Simon explained, GHC's current defaults are a very nice point in the
> programming space for people who are actively building and changing their
> programs.

It's easy to build arguments for either side, but my experience as a
professional developer is that new devs don't know what arguments they need
for reasonable performance, often knowing even what various optimization
flags do, but experienced developers do know the difference between -O0 and
-O1, and frequently need -debug (not a default option) more than -O0.

Seasoned GHC users can find that -O0 gives miserably slow compile times,
and fall back to GHCi for edit/rebuild cycles... which still aren't
terribly fast if you're using GHC's advanced features. I have a couple
small modules that take 10 minutes each to compile on a current Core i7 at
-O0, and -O2 really doesn't take much longer. GHCi is very slightly faster
but I'll still head directly downstairs for a coffee as soon as either of
these bad boys need rebuilding... and still make it back upstairs before
they're done.

And so I'd prefer the default to be -O1 or even -O2 and have people who
really need it use -O0. GHC shouldn't be painful on purpose, industrial
strength or not.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Glasgow-haskell-users mailing list