On Thu, 2004-04-22 at 14:44, Dan Sugalski wrote:
> At 1:05 PM -0400 4/22/04, Aaron Sherman wrote:

> >This is in direct contradiction to what I'm hearing from you, Dan.
> >What's the scoop?
> 
> The scoop is that
> 
>     my Joe $foo;
> 
> emits the code that, at runtime, finds the class ID of whatever Joe's 
> in scope, instantiates a new object of that class, and sticks it into 
> the $foo lexical slot that's in scope at runtime.

Right, ok, good. I gotcha.

But according to A12 as I understand it, the part BEFORE that, which
looked innocently like a definition:

        class Joe { my $.a; method b {...} }

would actually get turned into a BEGIN block that executes the body of
the class definition as a closure in class MetaClass and stores the
result into a new object (named "Joe") of class Class.

Perl 6's compiler does not (by default, at least) know how to run code.
It just knows how to translate that text into bytecode (or IMCC or
something). So it will need SOMETHING to execute, possibly multiple
times with parsing going on before, after or during some of those
executions.

During is the hard one. That means you have to actually call back from
Parrot into the Perl 6 compiler. But, even the simple:

        eval "eval 'eval 1' "

causes that problem. How does Ponie deal with that? Does it simply act
as an interpreter for the first pass and then do code-gen ala -MO ? If
so, that's a nice dodge, but putting a full Perl 6 interpreter into Perl
6's compiler seems to me to be a tad heavy-weight.

Thoughts? Am I missing a simple way to get around this?

-- 
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