That is way cool.

Though I'm not sure that all of the constructs of another language are
going to be that easy to map into perl opcodes. Arithmetic, sure. But
perl opcodes aren't exactly a universal intermediate language.

Just in looking at your example, it seems like some complex replacements
would be a bit of a pain to generate. It would be nice to have a
specification for those opcode replacements. Like, say, perl code. How
hard would it be to do:

use constant SUBTRACT_TWO_THINGS => B::eval(<<'END');
print("Subtracting!!!\n"),
$XYZZY_PLACEHOLDER_PARAM1-$XYZZY_PLACEHOLDER_PARAM2
END

CHECK {
.
.
.
$z = new B::subst_op(SUBTRACT_TWO_THINGS, XYZZY_PLACEHOLDER_PARAM1 =>
$x->first, XYZZY_PLACEHOLDER_PARAM2 => $x->last);
.
.
.
}

Reply via email to