Should GHC default to -O1 ?
Duncan Coutts
duncan.coutts at googlemail.com
Wed Nov 9 15:48:31 CET 2011
On 9 November 2011 13:53, Greg Weber <greg at gregweber.info> wrote:
> How much does using ghc without cabal imply a newer programmer? I don't use
> cabal when trying out small bits of code (maybe I should be using ghci), but
> am otherwise always using cabal.
The main reason cabal has always defaulted to -O is because
historically it's been assumed that the user is installing something
rather than just hacking on their own code.
If we can distinguish cleanly in the user interface between the
installing and hacking use cases then we could default to -O0 for the
hacking case.
Duncan
> On Wed, Nov 9, 2011 at 3:18 AM, Duncan Coutts <duncan.coutts at googlemail.com>
> wrote:
>>
>> On 9 November 2011 00:17, Felipe Almeida Lessa <felipe.lessa at gmail.com>
>> wrote:
>> > On Tue, Nov 8, 2011 at 3:01 PM, Daniel Fischer
>> > <daniel.is.fischer at googlemail.com> wrote:
>> >> On Tuesday 08 November 2011, 17:16:27, Simon Marlow wrote:
>> >>> most people know about 1, but I think 2 is probably less well-known.
>> >>> When in the edit-compile-debug cycle it really helps to have -O off,
>> >>> because your compiles will be so much quicker due to both factors 1 &
>> >>> 2.
>> >>
>> >> Of course. So defaulting to -O1 would mean one has to specify -O0 in
>> >> the
>> >> .cabal or Makefile resp. on the command line during development, which
>> >> certainly is an inconvenience.
>> >
>> > AFAIK, Cabal already uses -O1 by default.
>>
>> Indeed, and cabal check / hackage upload complain if you put -O{n} in
>> your .cabal file.
>>
>> The recommended method during development is to use:
>>
>> $ cabal configure -O0
>>
>>
>> Duncan
>>
>> _______________________________________________
>> Glasgow-haskell-users mailing list
>> Glasgow-haskell-users at haskell.org
>> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
>
More information about the Glasgow-haskell-users
mailing list