Perl 6
SMOP Mold: Revision 15

(Mold is currently under implementation)
SMOP Mold is a register based interpreter implementation
A DSL called m0ld is used to represent mold opcodes in text form

A Mold block(?) 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 1,2,3 are initialised with

  • interpreter
  • identifier
  • capture

Mold opcodes

  1. call invocant,identifier,named,positionals,target
  2. call2 responder,capture,target
  3. goto label - jumps to label
  4. br register,iftrue,iffalse - jumps to iftruel if the native bool in register is true to iffalse otherwise

$*OUT.print("hello world\n") is translated to

  1. register declarations

my $r9;
my $r10; # we have to store even unused return values somewhere

  1. 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($8);

The opcodes part ultimatly compiles to such byte code

1 4 5 1 6 0 9
1 9 7 1 8 0 10
0


Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

 
 
 
File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

 
 
 
Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.

Tag: 

Suggestions: