On Fri, Aug 13, 2010 at 11:08:30AM -0400, Aaron Sherman wrote:
> On Thu, Aug 12, 2010 at 3:48 PM, Darren Duncan <dar...@darrenduncan.net>wrote:
> 
> >
> > What is the difference between Parrot bignums and gmp?  Could Parrot not
> > just use gmp to implement its bignums? --  Darren Duncan
> >
> 
> Parrot does use GMP. What we're discussing is how appropriate those are for
> Perl 6. My feeling is that the closer Perl 6 can get to using GMP directly,
> the better. If we need to wrap Parrot BigInt in a Perl 6 class, that
> wouldn't be terrible.

It ultimately needs to be wrapped into a Perl 6 Int -- there's not a
separate "big integer" type.  

Or, put another way, we need Rakudo's Int class to be smart enough to 
adapt to using a bigint representation (e.g., Parrot's BigInt PMC)
whenever the values are outside of a native int.

Pm

> I've been trying to get that to work myself, but I've been struggling with
> getting a PIR BigInt into a Perl 6 attribute via Q:PIR. When I do this:
> 
>                         .local pmc value, attr
>                         .local pmc b
>                         value = find_lex "$value"
>                         b = new ['BigInt']
>                         b = value
>                         attr = find_lex "$field"
>                         attr = b
> 
> Where $field is the variable I want to store, $field.WHAT is Int(). 

Note that .WHAT won't typically work on Parrot native values,
unless they've somehow been registered into the P6object framework.

Pm

Reply via email to