I've been playing with embedding Parrot and trying to pass arbitrary PIR code
to the embedded interpreter. The easiest approach I've found so far is to
create a small eval.pbc file that takes one argument in argv as PIR code to
eval and execute.
(There should really be easier approaches, but I digress.)
Unfortunately, it appears that there is no PIR compiler available to embedded
Parrot. I'll check in a test to t/src/extend.t as soon as I get a bug number
here. My PIR code is:
.sub main :main
.param pmc argv
.local int argc
.local pmc compiler
compiler = compreg 'PIR'
.local string code
code = argv[1]
.local pmc new_sub
new_sub = compiler( code )
new_sub()
.end
-- c
>
> Unfortunately, it appears that there is no PIR compiler available to
> embedded
> Parrot.
The PIR compiler is registered within imcc_init(), which should
probably called automagically during Parrot init sequence. See also
compilers/imcc/main.c.
leo
> The PIR compiler is registered within imcc_init(), which should
> probably called automagically during Parrot init sequence. See also
> compilers/imcc/main.c.
Okay, here's the patch I checked in as #13066. The IMCC headers need some
cleanup. Andy?
-- c