[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: So, what the heck is a continuation anyway?

On Tue, Dec 11, 2001 at 10:26:42AM -0500, Jeremy Hylton wrote:
> Perhaps it's worth asking the question another way:  How hard is it to
> write a compiler for Perl? 

*Given that* we can create our own custom Parrot bytecode operations,
it's pretty trivial. Once the runtime's there, of course.

> What are the major sources of complexity in the Perl5 compiler? 

Lexing, mainly. Again, the compilation becomes relatively trivial if you
know that you can compile, say, a high-level "print" statement into a
high-level "print" VM op that, by design, will do exactly what you
expect from a Perl point of view. It gets more difficult if you have to
compile "print" down to individual operations which load lists onto a
stack, load the file handle into the right place, and so on. It's an
impedence thing again. I have a feeling that if you're going down to
Scheme bytecode, the ops that you have to deal with are more level than
you want, and that would introduce complexity.

But I haven't tried it, so I may be wrong. 

>Do you think they'll disappear with Perl6?

No, and I don't think they'll disappear for Parrot, because we want
Parrot to run Perl 5 too. :)

dd.c:	sbrk(64);	/* For good measure */
    - plan9 has a bad day