[Haskell] Re: sizeFM type

Sven Panne Sven.Panne at aedion.de
Mon Apr 26 21:20:10 EDT 2004


Robert Will wrote:
> I understand the Int type to be as large as pointers on each kind of
> hardware. [...]

... excluding "unimportant" architectures like DEC Alpha (at least with
one of DEC's early C compilers), x86 in real mode, tons of embedded
processors in hundreds of millions of mobile phones, digital cameras,
microwave ovens, etc. :-] This assumption is simply not true in general,
and that's why e.g. C99 has intptr_t and friends.

And my guess is that even if the Haskell language was designed today, we
would have a "bare-bones" integer type at a very prominent place. Losing
a factor of 2-5 (wild guess) in terms of performance is simply not an option
for some applications. Of course one can always wait about a year until that
performance gap is filled by newer hardware, but I wouldn't want to tell
that my boss... :-) And even then the factor would still exists, of course.

Perhaps one could drop the Int/Integer distinction altogether if there was
a global switch for what "Int" should mean. But separate compilation and the
FFI would complicate things quite a bit then, I guess.

Cheers,
    S.



More information about the Haskell mailing list