On Tue, 2004-04-20 at 18:06, Leopold Toetsch wrote:
> Aaron Sherman <[EMAIL PROTECTED]> wrote:

This horse is getting a bit ripe, so I'm going to skip most of the
detail. I think we all agree on most of the basics, we just disagree on
what to do with them. That's cool.

I do want to pick a couple of small nits though:

> Well, yes. Except for the special case, which is nice though:
> 
> $ time parrot ih.imc  #[1]
> real    0m0.370s
> 
> $ time perl i.pl      #[2]
> real    0m5.656s

That's unrealistic. In P6, you should be able to take:

        @a >>+<< @b

and turn it into:

        # Trivial example of hyper-operation, untested pseudo-IMCC
        # Just take __Perl_Ary_a and add it to __Perl_Ary_b and put
        # the result in tmp5
        .local int tmp1
        tmp1 = 0
        .local int tmp2
        tmp2 = __Perl_Ary_a
        .local int tmp3
        tmp3 = __Perl_Ary_b
        .local int tmp4
        # Not sure what the ? is below... is there a typeof?
        .local ? PerlArray tmp5
        tmp5 = new .PerlArray
        # We auto-extend here... that may not be P6's eventual MO
        # but it's enough to get the point across
        if tmp2 >= tmp3 goto AutoExtend_HYPER_1
        __Perl_Ary_a = tmp3
        tmp4 = tmp3
        goto PRE_HYPER_1
        AutoExtend_HYPER_1:
        __Perl_Ary_b = tmp2
        tmp4 = tmp2
        PRE_HYPER_1:
        tmp5 = tmp4
        BEGIN_HYPER_1:
        if tmp1 >= tmp4 goto END_HYPER_1
        tmp5[tmp1] = __Perl_Ary_a[tmp1] + __Perl_Ary_b[tmp1]
        CONT_HYPER_1:
        # I forget if there's an inc op....
        tmp1 = tmp1 + 1
        goto BEGIN_HYPER_1
        END_HYPER_1

Are we seriously suggesting that after JIT, that's going to be as slow
as raw Perl, or even any slower than:

        .local ? PerlArray tmp1
        hyper
        tmp1 = __Perl_Ary_a >>+<< __Perl_Ary_b

?! If so, I'm curious to know why. It seems to me that you're just
moving the work from the Perl 6 compiler all the way down to the JIT,
but the resulting code is the same, no?

I would agree that a bulk array copy and iterators should go in Parrot.
That much would speed up many things (especially the above code).

Putting Perl 6 features into Parrot without factoring out their modular
essence would seem to me to result in a great deal of duplication, but
now I'm starting to get close to that horse again....

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


Reply via email to