> This has come up before and the discussion
> always semi-warnocks, but 

Yeah...

> 1) Have a version of the binary vtable
>    methods that create the destination PMC
> 2) Make a universal assignment PMC that
>    takes on the characteristics 
>    of the RHS of the assignment
> 3) Have a "this PMC intentionally left blank"
>    flag to   mark blank PMCs
>    and have vtable methods check that first

> #1 doubles the number of vtable entries. Ick.
> #2 has the most overhead
> #3 leaves it to the vtable methods to check,
>     which is error prone. 

Well, as I was saying last summer, #1 is really what
the add instruction should have done in the first
place, as that would make it behave the same way as it
does for ints and floats (replacing the value, not
altering the current one), and it is what most high
level languages expect, anyway.

However, my argument was mostly about the former (that
opcode name and IMCC syntax should differentiate
between the 2 types of behavior) rather than the
latter (that there should be a non-destructive version
of PMC add).

The Right Thing to do would be to rename the current
add op to "add_destructive" or something, and call the
new one just "add", acting like add for ints and
floats. The imcc "a = b + c" opererator would use the
non-destructive version.

But judging by the way I was pretty much ignored the
first time, and that Dan's already using Parrot at
work, and nobody wants to re-write the code they
started working on last week, I don't expect that to
actually happen. But it would be the Right Thing.

whether or not any opcode renaming is done, I'd say
that adding the non-destructive ops is probably the
best thing to do, as HLLs are going to want them
anyway. It certainly makes the compiler's job a lot
easier, and would lead to much cleaner output.
Otherwise these operations would have to be
implemented as methods (or something) in any case
where the compiler doesn't know *exactly* what kind of
object an arithmetic operation will result in.

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

Reply via email to