returning to cost of Integer

John Meacham john at repetae.net
Wed Aug 2 18:56:08 EDT 2006


On Thu, Aug 03, 2006 at 02:12:15AM +0400, Bulat Ziganshin wrote:
> the main condition is to use some special Int30# type instead of Int#
> (which we got used to be 32 bits long). i.e. for the type [Char},
> where Char= C# Int30# it will be ok, but for [Int] it will be bad
> (i know about Haskell standard, but how many programs relies on 32-bit
> Ints?)

Hopefully none, as the standard only guarentees Int to be at least 29
bits to allow tagging implementations of haskell 98 to exist. In any
case, it shouldn't matter for Integer, as it would fall over to the
bigint representation when you try to put something bigger in there.

For the case of representing constructors inside of pointers, it also
doesn't make a difference assuming you have a data type with less than
2^30 constructors. :) but then again, it can always fall over into using
a pointer. 

In any case, I don't think it is being proposed that this be used for
all Ints, just for a more efficient representation of bigints. though,
ideally, I'd hope whatever bigint library we use is smart enough to
handle small integers efficiently on its own.


        John

-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the Glasgow-haskell-users mailing list