On Fri, Apr 15, 2005 at 11:11:00PM -0400, Bob Rogers wrote:
: By the same token, couldn't one reasonably ask for a boolean array that
: required BigInt subscripts, even on said 32-bit machine?  (Once boolean
: arrays actually store one element per bit, that is.)  Or are subscripts
: this large ruled out?

It's certainly reasonable to have some way of allocating a bit array
that big.  If you have to turn you're entire memory into a bit array,
that's fine by me.  I've never been much into arbitrary limits.

But my question as a language designer then has to be:  What do you
mean by "ask for", and is merely asking for any bit array the same
thing as asking for one that big?

:    Or are you using "integer" conceptually to include both Integer and
: BigInt?

Whether I am or not depends on whether I take a big speed hit for
the generality.  I like generality, but I also want Perl 6 to be
fast in the common case, as long as it is not too difficult for
the compiler to figure out which cases are not the common ones.
Syntactically speaking, Perl 6 can easily distinguish

    my bit @array is shape(int);        # native int subscript

from

    my bit @array is shape(Int);        # big int subscript

but I'm just wondering which I should be thinking of as the default for

    my bit @array;

It seems to me that assuming shape(int) is not generally going to
be a hardship on people, especially once 64-bit machines get to be
the norm.  And if it means that the optimizer can do tricks and eek
some more speed out, then I'm willing to force the occasional user
to declare shape(Int) when they want the generality.

Larry

Reply via email to