Perl 6
SMOP: Revision 140

Simple Meta Object Programming / Simple Matter Of Programming

If you want to help SMOP, you can just take on one of the lowlevel S1P implementations and write it. If you have any questions ask ruoso or pmurias at #perl6 @

The Slides for the talk Perl 6 is just a SMOP are available, it introduces a bit of the reasoning behind SMOP. A newer version of the talk presented at YAPC::EU 2008 is available

SMOP is an alternative implementation of a C engine to run Perl 6. It is focused in getting the most pragmatic approach possible, but still focusing in being able to support all Perl 6 features. Its core resembles Perl 5 in some ways, and it differs from Parrot in many ways, including the fact that SMOP is not a Virtual Machine. SMOP is simply a runtime engine that happens to have a interpreter run loop.

The main difference between SMOP and Parrot (besides the not-being-a-vm thing), is that SMOP is from bottom-up an implementation of the Perl 6 OO features, in a way that SMOP should be able to do a full bootstrap of the Perl 6 type system. Parrot on the other hand have a much more static low-level implementation (the PMC)

The same way PGE is a project on top of Parrot, SMOP will need a grammar engine for itself.
SMOP is the implementation that is stressing the meta object protocol more than any other implementation, and so far that has been a very fruitful exercise, with Larry making many clarifications on the object system thanks to SMOP.

Important topics on SMOP

  • SMOP doesn't recurse in the C stack, and it doesn't actually define a mandatory paradigm (stack-based or register-based). SMOP has a Polymorphic Eval, that allows you to switch from one interpreter loop to another using Continuation Passing Style. See SMOP Stackless.
  • SMOP doesn't define a object system in its own. The only thing it defines is the concept of SMOP Responder Interface, which then encapsulates whatever object system. This feature is fundamental to implement the SMOP Native Types.
  • SMOP is intended to bootstrap itself from the low-level to the high-level. This is achieved by the fact that everything in SMOP is an Object. This way, even the low-level objects can be exposed to the high level runtime. See SMOP OO Bootstrap.
  • SMOP won't implement a parser in its own, it will use STD or whatever parser gets ported to its runtime first.
  • In order to enable the bootstrap, the runtime have a set of SMOP Constant Identifiers that are available for the sub-language compilers to use.
  • There are some special SMOP Values Not Subject to Garbage Collection.
  • A new interpreter implementation SMOP Mold replaced SLIME
  • The "official" smop Perl 6 compiler is mildew - it lives in v6/mildew
  • Currently there exists an old Elf backend which targets SMOP - it lives in misc/elfish/elfX

Other matters

SMOP Development ROADMAP

In order to keep this simple, the ROADMAP will stay here and will be edited as needed.


  • x.x.x have the initialisation sequence be automaticly infered from the dependencies of components on each other'
  • x.x.x convert S1P RI's to the RI DSL

S1P - Read it "Swamp"


  • x.x.x - Implementation of SMOP Capture Expansion, as in $candidate.BUILDALL(|@protoobjects, |%initialize)
  • x.x.x - "gather"/"take" operators
  • x.x.x - feed operators

actual S1P

  • x.x.x - draft output of what s1p compiler would generate
  • x.x.x - s1p compiler
  • x.x.x - Default MetaClass implementation (This is the default Perl 6 OO Meta Class)
  • x.x.x - src-s1p/ compiled to src-s1p/Object.c
  • x.x.x - working
  • 0.3.0 - Object with all features working

Completing SMOP runtime

  • 0.3.1 - SMOP NATIVE prototypes and lowlevel operators
  • 0.3.2 - Undef builtin types.
  • 0.3.3 - Immutable builtin types.
  • 0.3.4 - Mutable builtin types.

Perl 6 SMOP

  • 0.5.0 - STD AST types.
  • 0.6.0 - STD AST -> runtime frames (real interpreter)
  • 0.7.0 - STD SMOP backend
  • 1.0.0 - STD bootstraps in SMOP

Other Features

  • x.x.x - perl5 embedded - libperl
  • x.x.x - parrot embedded - libparrot
  • x.x.x - python embedded (stackless python?)
  • x.x.x - jvm embedded - libgcj
  • x.x.x - spidermonkey embedded - libmoz-js

SMOP Changelog

Usually, things from ROADMAP should come to here when its done.

It should be noted that the current progress is visible in the mildew test suite, the changelog should be seen in the svn repository...

2008-10-28 - Daniel Ruoso

  • x.x.x - SMOP p5 binding in place. It allows creating native ints and const identifiers, but it also lets you build and run a mold.

2008-10-27 - Daniel Ruoso

  • x.x.x - Proposed implementation of and in place, now moving to other built-in types.

2008-10-08 - Daniel Ruoso

  • x.x.x - SMOP__S1P__ritest provides a way to check for objects of a specific repr.
  • x.x.x - signature for postcircumfix:<( )> is now :($capture) instead of :(|$capture)

2008-10-07 - Daniel Ruoso

  • x.x.x - SMOP__S1P__AdhocSignature should help the built-in types.

2008-09-20 - Daniel Ruoso

  • x.x.x - grep operator

2008-09-19 - Daniel Ruoso

  • x.x.x - SMOP map operator ('for' is simply a synonym for 'map')
  • x.x.x - map($code, $iterator).Void() # map in void context consumes all the input iterator
  • x.x.x - Array.unshift

2008-09-17 - Daniel Ruoso

  • x.x.x - Array.Iterator().FETCH().prefix:<=>() working... test passing, some leaks still...

2008-09-07 - Daniel Ruoso

  • x.x.x - Array.Iterator().FETCH() # array iterator in item context -- almost working, test with a false pass...

2008-09-01 - Daniel Ruoso

  • x.x.x - native int postfix:<++>

2008-08-27 - Daniel Ruoso

  • x.x.x - BindCaptureSignature implemented. This special signature should be used in s1p to simplify signature usage. The signature is :(|$_) and allows the actual signature to be generated as a prefixed code on the mold block....

2008-08-22 - Daniel Ruoso

  • x.x.x - pure prototype metaclass instance

2008-08-20 - Daniel Ruoso

  • x.x.x - Port code to Mold and use the defaultblocksignature.

2008-08-16 - Daniel Ruoso

  • x.x.x - Signature object.
  • x.x.x - Default block signature binds the capture to the inner scope.

2008-08-11 - Daniel Ruoso

  • x.x.x - LexicalScope is finished! Lookup works as expected, the tests pass. This is the first use of a singleton mold code that is reused several times in the same execution...

2008-08-07 - Daniel Ruoso

  • x.x.x - LexicalScope implementation, almost all features working only lookup is missing.

2008-08-04 - Daniel Ruoso

  • x.x.x - Make lowlevel method use a code object instead of a c callback function

2008-08-02 - Daniel Ruoso

  • 0.2.3 - Low-level Attribute implementation (test passing)

2008-07-31 - Daniel Ruoso

  • x.x.x - Low-level attribute implemented (tests still failing)
  • x.x.x - Scalar no longer delegates the calls (that causes unexpected results with containers that supports other methods), the language operators should do the implicit FETCH calls when the value is used. This means that every object should support FETCH, even if it returns the object itself. STORE however is not mandatory, as you have read-only containers, and therefore read-only values.

2008-07-26 - Daniel Ruoso

  • x.x.x - Low-level Code implementation

2008-07-25 - PaweĊ‚ Murias

  • x.x.x - Low-level Array implementation
  • x.x.x - Low-level Hash implementation

2008-07-25 - Daniel Ruoso

  • 0.2.2 - p6opaque Responder Interface (This is the default Perl 6 OO Responder Interface)

2008-07-24 - Daniel Ruoso

  • x.x.x - p6opaque refactoring almost finished. After much debate the final p6opaque format is documented in SMOP p6opaque Implementation. Metaclass delegation is already working again. Now p6opaque uses directly Scalars, Hashes and Arrays instead of a lowlevel implementation of that. This is indeed much simpler (pmurias++ for pushing in that direction)
  • x.x.x - ___NATIVE_CAPTURE_ONLY___, ___CONST_IDENTIFIER_ONLY___ and ___INVOCANT_RI_SHOULD_MATCH___ are C macros that do some sanity checking on the lowlevel invocation.
  • x.x.x - p6opaque_proto_storage completed!
  • x.x.x - accessor for every member of p6opaque implemented.

2008-07-18 - Daniel Ruoso

  • x.x.x - Define yet another phase into the boot sequence for things that need a interpreter instance
  • x.x.x - interpreter.goto(bool) means "release the current continuation"

2008-07-16 - Daniel Ruoso

  • x.x.x - $p6opaque.^!methods.push($method) calls $p6opaque.^!methods.register($identifier, $signature, $method), fetching the information from the method object.

2008-07-15 - Daniel Ruoso

  • x.x.x - all tests valgrind-clean again. test/14 still missing the two functions.

2008-07-11 - Daniel Ruoso

  • x.x.x - $p6opaque.^!methods() working, it returns a proxy object that will introspect inside the p6opaque. test/14 still with memory leaks.

2008-07-10 - Daniel Ruoso

  • x.x.x - tests revised after some sm0p changes. test/14 is written and compiles, but it still fails the tests.

2008-07-09 - Daniel Ruoso

  • x.x.x - lowlevel method uses the new signature for "call". This is important for the test/14 still in development.

2008-07-08 - Daniel Ruoso

  • x.x.x - smop_lowlevel only uses capture-less DESTROYALL call for a few selected types.

2008-07-04 - Daniel Ruoso

  • x.x.x - p6opaque successfully delegates the calls to the metaclass (valgrind-clean)

2008-03-11 - Daniel Ruoso

  • x.x.x - Low-level Scalar implementation

2008-02-22 - Daniel Ruoso

  • 0.2.1 - Low-level Method implementation (this is not the standard Method type, just something that complies to the API)

2008-02-14 - Daniel Ruoso

  • x.x.x - Runtime creation of constant identifiers

2008-02-05 - Daniel Ruoso

  • FIRST MAJOR MILESTONE ACHIEVED: sm0p - Lame Default SMOP Interpreter Implementation
  • 0.2.0 - Final review on SMOP REFERENCE and RELEASE Policy and code revision for memory leaks.

2008-02-01 - Daniel Ruoso

  • 0.1.4 - Final review on Continuation Passing Style implementation

2008-01-31 - Daniel Ruoso

  • 0.1.3 - sm0p preprocessor
  • x.x.x - Several bug fixes in the capture and in slime.
  • x.x.x - 02_stack.t does ok 1..4 for the first time, this means that sm0p is interpreted correctly

2008-01-24 - Daniel Ruoso

  • x.x.x - Automake prepared to run the sm0p preprocessor.
  • 0.1.2 - SMOP SLIME prototypes and lowlevel operators
  • x.x.x - SMOP__SLIME__Capturize
  • x.x.x - SMOP__SLIME__Node
  • x.x.x - native int type
  • x.x.x - SMOP__SLIME__CurrentFrame

2008-01-23 - Daniel Ruoso

  • x.x.x - SMOP__SLIME__Frame first code
  • x.x.x - native bool type

2008-01-21 - Daniel Ruoso

  • 0.1.1 - Capture type (lowlevel implementation)

2008-01-18 - Daniel Ruoso

  • 0.1.0 - Port YAP6__CORE__Value code to SMOP__Object code.
  • 0.x.x.x - "Identifier Name Constant" type and the definition of the pool of constants.

See also the Old YAP6 Changelog.

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.