On Wed, 21 Apr 2004, Aaron Sherman wrote:

> On Wed, 2004-04-21 at 10:13, Simon Glover wrote:
>
> >  Absolutely -- I really, _really_ want to be able to use hyper ops with
> >  fixed size, floating point arrays, and to have that be as fast as
> >  possible, as that should make it possible to implement something like
> >  PDL in the core.
>
> Mistake.
>
> You don't want to have to convert to-and-from arrays of PMCs in order to
> do those ops, and regardless of what kind of hyper-nifty-mumbo-jumbo you
> put into Parrot, that's exactly what you're going to have to do.
>

 Why? I was under the impression that in Perl 6 it was going to be
 possible to declare arrays that only contain values of a particular
 type -- I believe the syntax I saw was:

   my @array is float;

 although I've not been following p6l, so this may have changed somewhat.
 Are you saying that despite that, those values still have to be PMCs?
 If so, then you're quite right -- I would make no sense to convert them
 to floats and then back again -- but this also means that core Perl 6
 is not going to be nearly as useful to me as I had hoped.

> In fact, Parrot Data Language (if there were such a thing) would likely
> introduce its own runtime-loadable opcode set to operate on a new PMC
> type called a piddle. Then, each client language could define (in a
> module/library) its own means of interacting with a piddle. For example
> in Perl, you might:
>
>       multi method new(Class $class, int @ary) {...}
>       multi method new(Class $class, float @ary) {...}
>       multi method new(Class $class, int $value) {...}
>       multi method new(Class $class, Octets $value: %*_) {...}
>
> and then you would override BUILD in order to emit your special piddle
> opcodes.
>
> Then, in user-space:
>
>       my PDL::Piddle $foo = [1,2,3,4,5,6];
>
> Does what you expect, and
>
>       $foo + $bar
>
> is special.

 This is all very well, but it places a much larger hurdle in the way of
 someone wanting to use Perl 6 for these kinds of computationally
 intensive array manipulations, particularly if our hypothetical Perl 6
 version of PDL isn't a core module.

 Simon

Reply via email to