[perl #36330] [TODO] Create a BigNum PMC
jerry gay
jerry.gay at gmail.com
Thu Feb 5 16:57:18 UTC 2009
On Thu, Feb 5, 2009 at 08:45, Andrew Whitworth via RT
<parrotbug-followup at parrotcode.org> wrote:
> On Thu Feb 05 08:40:47 2009, particle wrote:
>> On Thu, Feb 5, 2009 at 08:26, Andrew Whitworth via RT
>> <parrotbug-followup at parrotcode.org> wrote:
>> > 1) Are we going to be relying on libraries to handle our BigInt/BigNum
>> > implementations, or are we intending to roll our own?
>>
>> we can't rely on external libraries, whether for bignum, unicode, gc,
>> or anything else. we can detect and use them, however, if they exist.
>>
>> ~jerry
>>
>
> Okay, maybe "rely" was the wrong word to use. Current implementation of
> BigInt.pmc uses GMP if it's available, else it throws exceptions that
> there is no bug number library present to implement the behavior. Same
> is true of the unicode charset and ICU. We don't require ICU or GMP to
> build parrot, but we don't implement these behaviors without them.
>
but we do implement these behaviors, at least some of them. for
example, i don't have icu installed, but i can still use french quotes
in rakudo. i'll get an exception if i try to downcase a string of
japanese text (a silly example, but it won't throw if i have icu)
because not all unicode functionality has been implemented natively
*yet*.
> Question is: Are we going to do this same thing for BigNum (use a
> library if present, throw sane exceptions otherwise), or are we going to
> roll our own BigNum implementation?
>
we will roll our own bignum, and give users the ability to use gmp or
another external library at configure time. until we do roll our own,
we should provide a default implementation that throws descriptive
exceptions.
~jerry
More information about the parrot-dev
mailing list