|
Perl 6
SMOP Mold: Revision 6
SMOP Mold is a register based interpreter implementation
A Mold frame is composed of three parts * the number of registers used by the program (not counting the ones used to put constants or the 3 special ones) * constants - which are put into registers * opcodes The registers 0,1,2 are initialised with * interpreter * identifier * captures Mold opcodes * goto label - jumps to label * call invocant,identifier,named,positionals,target * call2 responder,capture,target * br register,iftrue,iffalse - jumps to iftruel if the native bool in register is true to iffalse otherwise Example in p6 syntax what would $*OUT.print("hello world\n") be translated to my $out; constant $OUT = "$*OUT"; constant $print = "print"; constant $curly = "postcircumfix:{ }"; constant $SMOP__S1P__RootNamespace = $SMOP__S1P__RootNamespace; constant $hello_world = "hello world\n"; $out = $SMOP__S1P__RootNamespace.$curly($OUT); $out.$print($hello_world); |