Having mentally absorbed the forth.pasm code, I thought I'd rewrite it
in PIR and try to make it a full parrot compiler and, hopefully, a bit
more approachable. I've already begun on this (see attached file).
Unfortunately, I've run into a few issues/questions along the way.

In the following, the term "eval" refers to the use of the
compreg/compile opcodes.

o In current builds evaling non PASM/PIR code segfaults (or gives a
bus error on OS X) as a result of the last patch to op/core.ops (See
#31573). Any plans here?
o Evaling PIR code requires a named subroutine and the use of the
'end' opcode. Someone mentioned on IRC that this might not be the
desired behavior. Is it?
o Calling subroutines from an eval creates a copy of the user stack,
so all changes are lost (rendering my Forth code unusable). Is this
behavior correct? If so, how should I go about this?

Any clarifications or statuses, as well as any comments on the PIR
code, would be very much appreciated. I'm more or less stalled at this
point until I get some answers/help. It would be nice to get this to
the point where it can be used to test parrot (as well as serve as an
example to anyone wanting to write a compiler).

-- 
matt

Attachment: forth.pir
Description: Binary data

Reply via email to