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

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



At 10:26 AM 12/11/2001 -0500, Jeremy Hylton wrote:
> >>>>> "SC" == Simon Cozens <simon@simon-cozens.org> writes:
>
>   SC> The original question was "Why don't you compile Perl to Scheme
>   SC> and use a Scheme VM?", and I replied that it was non-trivial to
>   SC> compile Perl to Scheme.
>
>If it's non-trivial to compile Perl to Parrot, then one might fairly
>ask whether it's better to re-use an existing backend or create a new
>one.  I think it would be relatively easy to compile Python to Scheme,
>provide the right run-time environment was also written in Scheme.

While I can't comment on the python->scheme transform, you're dead-on with 
the initial remark--if it was non-trivial to compile perl to parrot, the 
parrot project would be an utter waste of time.

>My sense of Parrot is that it pushes a fair amount of hard work back
>to the compiler.

That's mainly because the design's not fully documented. :) Things like the 
push/pop/shift/unshift/splice ops for arrays, or the make_closure op, or 
the map and grep opcodes aren't done.

Generally speaking, most language concepts get an op of their own. We've 
just started from the bottom and are working our way up in some respects. 
(Gotta add before you can integrate)

>Perhaps it's worth asking the question another way:  How hard is it to
>write a compiler for Perl?  What are the major sources of complexity
>in the Perl5 compiler?  Do you think they'll disappear with Perl6?

The compiler's easy. It's the lexing that's a major pain.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk