On  9 Sep, John Launchbury wrote:
> When we discussed this before I appealed for someone to try it out and
> report on the results:
> * What slowdowns (?speedups) can be expected in practice using Integer
>   rather than Int?
> * Do existing programs break wildly with this more general type, or
>   do they work just as before? Or do they still work but now produce
>   different answers than before.
> 
> Please can someone who feels strongly that we should make these changes
> perform some experiments and report the results.

Re speed: please don't!  I don't see how knowing about the speed of
existing implementations can affect the reasoning in deciding to make
the change. As far as I know, none of the existing implementations
takes the speed of Integer seriously (ghc certainly doesn't), so the
data obtained would be thoroughly misleading.  Furthermore, in a new
programme it would not be hard to decide where to use Int if one is
worried about speed. In an old programme discovering that it runs
slowly in Haskell 1.5 would not occasion terribly much work either -
you just have to change the import declarations to get hold of
specially defined versions of the relevant functions.  I'd agree that
it might be useful to provide a compatibility prelude with
implementations of 1.5.

As to the second point, if old programmes produce different results,
surely that's going to be because they were wrong in the first place!
If they don't compile, it's harmless.

So I don't think either of these experiments would be helpful.
Changing to Integer improves the design of the language and increases
the chance that programmes will give correct results. It's not as if
we are asking for Int to be banned!


  Jon


-- 
Jon Fairbairn                                 [EMAIL PROTECTED]
18 Kimberley Road                                        [EMAIL PROTECTED]
Cambridge CB4 1HH                      +44 1223 570179 (pm only, please)




Reply via email to