2006/6/24, Nicholas Clark <[EMAIL PROTECTED]>:
On Fri, Jun 23, 2006 at 01:43:03PM -0700, Matt Diephouse wrote:
[Parrot assembler implementation]
> Of course, that doesn't mean that I wouldn't like an opcode to do it for
> me. :-)
Is Parrot assembler considered a more productive language to write in than C?
If yes, is it logical to write opcodes such as this one in Parrot assembler
itself?
Err, well, that will likely completely kill the performance. :-)
I had an implementation before Parrot had lexical pads, using global
variables and manual walking to emulate it. It was horribly slow.
Especially consider that Pugs currently compiles:
my $x; sub f { say $x; ...
to
my $x; sub f { say $OUTER::x; ...
because later in the scope $x may be declared, so it's safer to just
put OUTER right there.
Of course, if we cannot have an efficient OUTER lookup, we can always
do a post analysis on the block body and convert unneccessary OUTER::
away, but I don't think it's a good idea to force compile writers to
do that.
Thanks,
Audrey