Handling non-standard integer types

Moritz Lenz moritz at faui2k3.org
Sun Feb 12 13:56:19 UTC 2012


Hi all,

the Perl 6 specification says we need to implement types such as UInt64,
that is an unsigned 64 bit integer. And Rakudo is now at the point where
it makes sense to support such types. For example a number type we use
fairly often is 'Rat', a rational number that stores the denominator as
such a uint64.

Are there any plans from the Parrot side to support more than integer
type? I'm pretty sure even 32bit machines support uint64 operation these
days (or are easy-ish to do with the help of the carry flag), but it'd
be quite hard to handle these types if they don't fit into Parrot's
integer registers.

On #perl6, Gerd R remarked that most arithmetic ops are the same for
signed and unsigned integers (assuming 2s complement), so it might make
sense to just always configure parrot to work with 64 bit ints, and
provide additional ops for those that work differently depending on
signedness (division, comparison).

Any thoughts?

Cheers,
Moritz


More information about the parrot-dev mailing list