Sean O'Rourke wrote:

[EMAIL PROTECTED] (Scott Walters) writes:


I have work-related reason to add a "B" backend for Perl 5 to the
perl6 compiler. I'm looking at creating an assembler for Perl 5's
"B" bytecode along the lines of IMCC, and creating patches against
languages/perl6/IMCC.pm and languages/perl6/IMCC/* to conditionally,
using some sort of phrasebook, generate assembly for either Parrot
or B.



This would involve some nontrivial refactoring, since both are
unashamedly machine-dependent, and freely emit blocks of assembly
directly from the AST walk. Unless B assembly is a lot like parrot
assembly, simply replacing (or factoring out) these chunks might not
be the best way. Of course, I've never used B assembly, so discount
this impression appropriately. Everything up to IMCC* (i.e. parsing,
tree munging, and "context" (wannabe typing)) should be fine, though.



I actually started to do some refactoring last night of languages/perl6 (I've decided to put my languages/java on hold until the class-metadata stuff is finalized.) What kind of refactoring would you suggest? Should we have some sort of generic "bytecode generation" package?

- Joe



Reply via email to