SOM: Simple Object Machine, logo
A minimal Smalltalk for teaching of and research on Virtual Machines.

SOM Language Example

Try SOM in a REPL Fibonacci = ( "defines a subclass of Object" fib: n = ( "defines the fib method with the argument n" ^ n <= 1 ifTrue: 1 ifFalse: [ self fib: (n - 1) + (self fib: (n - 2)) ] ) )
A simple class implementing #fib: to compute the fibonacci numbers.
For more, see the standard library

JsSOM Read-Eval-Print Loop

SOM Shell.
--->
Note, this REPL does accepts only simple expressions and does not allow to define classes or methods.
However, the complete standard library is available.

Key Characteristics

  • 9 main implementations
  • clarity of implementation over absolute performance
  • support for common language features such as objects, classes, closures, and non-local returns
  • support for benchmarks: DeltaBlue, Richards, ..., and the Are We Fast Yet benchmarks
  • implementations ranging from 2.5k LOC to 8k LOC
  • implementation variations include:
    • abstract-syntax-tree-based or bytecode-based
    • classic interpreter optimizations
    • green and native threading
    • reference counting, mark/sweep, and generational garbage collectors
    • using metatracing or partial evaluation for just-in-time compilation

Performance

Boxplot, performance comparison of SOM implementations.
Performance of some of the SOM implementations compared to Java.
Based on data from March 2019, using the Are We Fast Yet benchmarks.

SOM Implementations Overview

The various implementations support the same language, but use different optimizations, implementation techniques, and run on different platforms.

  • SOM

    • first implementation, in Java
    • bytecode-based
    • basic optimizations, e.g., inline caches
  • AweSOM

    • bytecode-based
    • implemented in Smalltalk
    • no optimizations
  • CSOM

    • first port to other language, C
    • bytecode-based
    • no optimizations
    • mark/sweep garbage collector
    • supports Emscripten/WebAssembler
  • SOM++

    • bytecode-based, with jump bytecodes
    • implemented in C++
    • tagged integers
    • mark/sweep, copying, and generational garbage collectors
    • With OMR: GC support and a just-in-time compiler
  • PySOM

    • abstract-syntax-tree or bytecode-based, in Python
    • RPython-compatible, and with metatracing-based just-in-time compilation
    • or as pure Python, no dependencies
  • TruffleSOM

    • implemented in Java, using the Truffle framework
    • abstract-syntax-tree-based
    • highly optimized
  • SOM-RS

    • abstract-syntax-tree-based or bytecode-based, in Rust
    • some optimizations, very similar to other SOM implementations
  • ykSOM

    • a bytecode-like interpreter, in Rust
    • an "clean room" implementation
    • focusing on idiomatic Rust, and fast interpretation
  • JsSOM

    • abstract-syntax-tree-based, in JavaScript
    • runs on Node.js and in browsers

SOM-based Language Implementations

SOM has been a platform for research that inspired a range of language implementations.

  • SOMNS

    • implementation of Newspeak
    • based on TruffleSOM
    • platform for research on concurrency and tooling
  • Moth

    • implementation of Grace
    • based on SOMNS
    • platform for research on concurrency and tooling
  • TruffleMATE

    • An extension of TruffleSOM with more standard Smalltalk support
    • platform for research on metaobject protocols and the Mate approach
  • TruffleMATE

    • An extension of RTruffleSOM with more standard Smalltalk support
    • platform for research on metaobject protocols and the Mate approach

Intro Presentation 2019

Overview of the SOM project and what it brings for teaching and research.

Teaching Material

Currently, we do not have much teaching material specific to SOM. We do have however an number of related slide sets, some somewhat historical, that give a basic overview. Other material is more specific, but can also be starting point.

  • Design and Implementation of Object-Oriented Virtual Machines.
    University of Aarhus 2001/2002
    Course material, SOM intro, SOM examples
  • Building Self-Optimizing Interpreters with Truffle or RPython.
    A Hands-On Tutorial.
    Stefan Marr
    Slides
  • UCB CS294-113: Virtual Machines and Managed Runtimes
    Mario Wolczko
    Course material

Community


For questions, discussions, and updates, you can:

Check all code on GitHub

Follow us on Twitter @SOM_VMs

Discuss with us on the som-dev mailing list,

or chat with us on Slack
(you may need to request an invited via twitter.com/SOM_VMs).

Use in Teaching and Research: A Brief Chronology

A brief and incomplete list of papers and universities where SOM has been used in the past.

Faculty of Information Technology Czech Technical University in Prague logo

In 2023, Filip Říha implemented HaSOM, a SOM written in Haskell as part of his Bachelor's thesis.

Publication

Efficient and Deterministic Record & Replay for Actor Languages
D. Aumayr, S. Marr, C. Béra, E. Gonzalez Boix, H. Mössenböck
Proceedings of the 15th International Conference on Managed Languages and Runtimes, ManLang'18, ACM, 2018, doi: 10.1145/3237009.3237015, PDF.

Publication

Few Versatile vs. Many Specialized Collections: How to design a collection library for exploratory programming?
S. Marr, B. Daloze
Proceedings of Programming Experience Workshop, PX/18, 2018, doi: 10.1145/3191697.3214334, HTML, PDF.

Publication

Fully Reflective Execution Environments: Virtual Machines for More Flexible Software
G. Chari, D. Garbervetsky, S. Marr, S. Ducasse
IEEE Transactions on Software Engineering, IEEE TSE, 2018, doi: 10.1109/TSE.2018.2812715, PDF.

Publication

A Concurrency-Agnostic Protocol for Multi-Paradigm Concurrent Debugging Tools
S. Marr, C. Torres Lopez, D. Aumayr, E. Gonzalez Boix, H. Mössenböck
Proceedings of the 13th ACM SIGPLAN International Symposium on Dynamic Languages, DLS'17, ACM, 2017, doi: 10.1145/3133841.3133842, HTML, PDF.

Publication

A Metaobject Protocol for Optimizing Application-Specific Run-Time Variability
G. Chari, D. Garbervetsky, S. Marr
Proceedings of the 11th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems, ICOOOLPS'17. (2017), doi: 10.1145/3098572.3098577, PDF.

Publication

Toward Virtual Machine Adaption Rather than Reimplementation: Adapting SOMNS for Grace
R. Roberts, S. Marr, M. Homer, J. Noble
Workshop on Modern Language Runtimes, Ecosystems, and VMs, MoreVMs'17. Extended Abstract. (2017), PDF.

Victoria University of Wellington logo

In 2017, James Noble started using SOMNS to implement the Grace language. Richard Roberts turned it into a working implementation called Moth.

Facultad de Ciencias Exactas y Naturales - Universidad de Buenos Aires, logo

TruffleMATE, a SOM variant with the Mate Metaobject protocol, which enables fully reflective execution environments.

Publication

Building Efficient and Highly Run-time Adaptable Virtual Machines.
Chari, Guido; Garbervetsky, Diego; and Marr, Stefan.
Proceedings of the 12th Symposium on Dynamic Languages (2016), PDF.

Publication

Cross-Language Compiler Benchmarking: Are We Fast Yet?
Marr, Stefan; Daloze, Benoit; and Mössenböck, Hanspeter.
Proceedings of the 12th Symposium on Dynamic Languages (2016), PDF, HTML.

IBM logo

In 2016, the J9 team used their new JitBuilder to speed up SOM++ by 3x-4x. JitBuilder is an API for the J9 just-in-time compiler, which is going to be open sourced as part of the Eclipse OMR project.

IBM logo

In 2015, the J9 team announced the plans to open source the platform underlying their JVM implementation. As part of their JavaOne talk “What's in an Object? Java Garbage Collection for the Polygot”, they used SOM++ as a case study to show how their garbage collector can be integrated into an existing VM.

Johannes Kepler University Linz, logo

SOMNS, a Newspeak variant with full support for actor concurrency was developed as a platform for research on the interaction of concurrency models.

Publication

Tracing vs. Partial Evaluation: Comparing Meta-Compilation Approaches for Self-Optimizing Interpreters.
Marr, Stefan; and Ducasse, Stéphane.
Proceedings of the 2015 ACM International Conference on Object Oriented Programming Systems Languages & Applications, ACM, (2015), PDF, HTML.

Publication

Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and without Compromises.
Marr, Stefan; Seaton, Chris; and Ducasse, Stéphane.
Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, ACM, (2015), doi: 10.1145/2737924.2737963, PDF, HTML.

Publication

Are We There Yet? Simple Language-Implementation Techniques for the 21st Century.
Marr, Stefan; Pape, Tobias; and De Meuter, Wolfgang.
IEEE Software 31, no. 5 (2014): 60-67, doi: 10.1109/MS.2014.98, PDF, HTML.

Software Languages Lab, Vrije Universiteit Brussel, logo

The SOM variants were used for a number of experiments such as ActorSOM, a SOM with a event-loop concurrency model similar to AmbientTalk.

Heinrich Heine Universität Düsseldorf, logo

SOM++ was optimized and extended with a generational garbage collector as part of a master's thesis.

Publication

CSOM/PL: A Virtual Machine Product Line.
Haupt, Michael; Marr, Stefan and Hirschfeld, Robert.
Journal of Object Technology 10, no. 12 (2011): 1-30, doi: 10.5381/jot.2011.10.1.a12, PDF.

Publication

Type Harvesting: A Practical Approach to Obtaining Typing Information in Dynamic Programming Languages.
Haupt, Michael; Perscheid, Michael and Hirschfeld, Robert.
Proceedings of the 2011 ACM Symposium on Applied Computing, 2011, doi: 10.1145/1982185.1982464, URL.

Publication

Virtual Machine Support for Many-Core Architectures: Decoupling Abstract From Concrete Concurrency Models.
Marr, Stefan; Haupt, Michael; Timbermont, Stijn; Adams, Bram; D'Hondt, Theo; Costanza, Pascal and De Meuter, Wolfgang.
Second International Workshop on Programming Languages Approaches to Concurrency and Communication-cEntric Software, York, UK, 2010, doi: 10.4204/EPTCS.17.6, URL.

Publication

The SOM Family: Virtual Machines for Teaching and Research.
Haupt, Michael; Hirschfeld, Robert; Pape, Tobias; Gabrysiak, Gregor; Marr, Stefan; Bergmann, Arne; Heise, Arvid; Kleine, Matthias and Krahn, Robert. Proceedings of the 15th Annual Conference on Innovation and Technology in Computer Science Education (ITiCSE), 2010, doi: 10.1145/1822090.1822098, PDF.

Technische Universität Darmstadt, logo

In 2010, SOM was used by Michael Haupt to teach one graduate course at Technische Universität Darmstadt (Germany).

Publication

NXTalk: Dynamic Object-oriented Programming in a Constrained Environment.
Beck, Martin; Haupt, Michael and Hirschfeld, Robert. Proceedings of the International Workshop on Smalltalk Technologies, 2009, doi: 10.1145/1735935.1735942, PDF.

Hasso Plattner Institute, logo

SOM was used by Michael Haupt between 2007–2009 to teach a course on Virtual Machines at the Hasso Plattner Institute in Potsdam. Many of the feature variants of CSOM for instance support for Smalltalk images, threads, and garbage collection have been developed as part of course work. (more)

Lancaster University logo

In 2006, SOM was used by Michael Haupt to teach one undergraduate course at Lancaster University (UK).

Publication

Related to SOM, at least in syntax and spirit:
Design, implementation, and evaluation of the Resilient Smalltalk embedded platform.
Andersen, Jakob R.; Bak, Lars; Grarup, Steffen; Lund, Kasper V.; Eskildsen, Toke; Hansen, Klaus Marius and Torgersen, Mads.
Computer Languages, Systems & Structures 31, no. 3–4 (2005): 127–141, doi: 10.1016/j.cl.2005.02.003, PDF.

Aarhus University (logo)

A kind of successor of SOM: OOVM, which went on to become Resilient Smalltalk
Revolutionizing Embedded Software
Master's Thesis by Kasper Verdich Lund and Jakob Roland Andersen

Aarhus University (logo)

SOM was originally implemented at the University of Århus in Denmark by Jakob Roland Andersen, Kasper Verdich Lund, Lars Bak, Mads Torgersen, and Ulrik Pagh Schultz in 2001/2002. It was used for teaching object-oriented VMs and came with the original version of the SOM Smalltalk libraries, test suites, and benchmarks.