At 09:34 PM 8/10/00 -0400, Bradley M. Kuhn wrote:
>Three notes on the Syntax tree (which I would probably call Intermediate
>Representation, or IR, but the name is irrelevant :).

Yep. It's more a MI, with bytecodes being an LI. (And both are IRs) I've 
been browsing through compiler design books, as if you couldn't tell... :)

>First, I believe that it is completely reasonable and probably useful to
>consider allowing an optimization step that operates directly on the IR.
>Bytecodes are often harder to optimize than the IR.

Fair enough. I think we should pass the syntax tree on to the optimzier in 
addition to the bytecode stream for just that sort of thing.

>Second, I think that it is terribly important that they format of the IR be
>well described in a document separate from the code.  I am willing to help
>maintain this document, but I think it is imperative that we don't let the
>"implementation be the reference".  If the code changes, the document much
>change to reflect it.

Oh, yes! Once things get a bit more solid on the language end, I expect 
we'll have syntax and bytecode working groups to hammer those out and nail 
'em down.

>Third, I am very glad that Dan has placed the execution engine very far from
>the IR.  Whether or not we want to have an execution engine (which I tend to
>call a VM :) that works directly on the IR or one that always goes through
>bytecode, or both, I think we must keep a high wall of abstraction between
>the IR and the VM.

Bytecode is an IR too, just with a different target.

I do want that heavy wall, though. That backend could be a perl2jvm 
translator, or a TIL version of the interpreter (if we don't go that way to 
start), or a frontend to a 'real' compiler like GCC or the Dec compilers. 
(Both gcc and the dec compilers have one backend for a whole bunch of 
language front-ends. If they can front-end fortran, C++, and cobol, we 
ought to be able to do it with perl...)

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to