Dan Sugalski wrote:
Yeah, but given that this code will be generated by compilers 90+% of the time... the assembly generation and parsing of the assembly's easier with the postfix notation.

My understanding is that compilers will generate an AST, not textual PIR. Thus, we are looking for a notation that's convenient for a human who has to work at the level of a compiler. In fact, I wouldn't be surprised if, post-1.0, this notation was never generated by anything but a PIR decompiler.


Currently, most compilers *do* generate textual PIR--but IIRC most of these compilers are written in high-level languages like Perl, where the difference between the notations is:

    print "["
    for(@keys) {
        print $_->data, ':', $letter{$_->type};
    }
    print "]";

vs.
    for(@keys) {
        print $left{$_->type}, $_->data, $right{$_->type};
    }

You may have a point about parsing, since that's done in C. However, I can't imagine it's *that* much more difficult to do (except that <>'s use in comparison ops might make that particular pair of characters unsuitable).

--
Brent "Dax" Royal-Gordon <[EMAIL PROTECTED]>
Perl and Parrot hacker

Oceania has always been at war with Eastasia.

Reply via email to