|
Perl 6
SMOP Mold: Revision 20
(Mold is currently under implementation) A Mold block(?) is composed of three parts
The registers 1,2,3 are initialised with
Mold opcodes
$*OUT.print("hello world\n") is translated to
# register declarations
my $r9;
my $r10; # we have to store even unused return values somewhere
# constants
my $r4 = $SMOP__S1P__RootNamespace;
my $r5 = "postcircumfix:{ }";
my $r6 = "$*OUT";
my $r7 = "print";
my $r8 = "hello world\n";
#opcodes
$r9 = $r4.$r5($r6);
$r10 = $r9.$r7($r8);
The opcodes part ultimatly compiles to such byte code 1 9 1 4 5 1 6 0 1 10 1 9 7 1 8 0 0 |