A SOM Smalltalk implemented on top of Oracle's Truffle Framework
Clone or download
Pull request Compare This branch is 27 commits ahead of smarr:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
core-lib @ 0e89006 Report non-master branches separately as experiments on Codespeed Jul 11, 2017
libs Update Truffle to latest version Jun 4, 2018
src Remove dummy implementation of deprecated methods Jun 5, 2018
tests/som/tests Replace PolyglotEngine with Context and use @option Jun 5, 2018
.checkstyle Added checkstyle and autoformat Jun 9, 2017
.checkstyle_checks.xml Update Checkstyle, needs some config changes Jun 4, 2018
.checkstyle_suppressions.xml Added checkstyle and autoformat Jun 9, 2017
.classpath Use @primitive from black diamonds Jan 3, 2018
.factorypath Replace PolyglotEngine with Context and use @option Jun 5, 2018
.gitignore .gitignore Mar 16, 2018
.gitmodules Added Black Diamonds submodule Jan 3, 2018
.graal-git-rev Update graal to 11ec1deb54c9b2aa2c3ded338e4115ca7b15e120 Apr 24, 2017
.project Remove ancient ANTLR files/settings Jul 14, 2017
.travis.yml Added checkstyle and autoformat Jun 9, 2017
Examples Restored directory structure by adding symlinks Sep 25, 2013
LICENSE Commit official version of SOM (Java) Mar 31, 2013
Makefile Added Makefile for the buildbot Dec 10, 2013
README.md Updated README.md Mar 27, 2016
build.xml Update Checkstyle, needs some config changes Jun 4, 2018
debug Replace old scripts with Python version Oct 6, 2015
som Added Black Diamonds submodule Jan 3, 2018


TruffleSOM - The Simple Object Machine Smalltalk implemented using Oracle's Truffle Framework


SOM is a minimal Smalltalk dialect used to teach VM construction at the Hasso Plattner Institute. It was originally built at the University of Århus (Denmark) where it was used for teaching and as the foundation for Resilient Smalltalk.

In addition to TruffleSOM, other implementations exist for Java (SOM), C (CSOM), C++ (SOM++), and Squeak/Pharo Smalltalk (AweSOM).

A simple Hello World looks like:

Hello = (
  run = (
    'Hello World!' println.

This repository contains the Truffle-based implementation of SOM, including SOM's standard library and a number of examples. Please see the main project page for links to other VM implementations.

Obtaining and Running TruffleSOM

To checkout the code:

git clone https://github.com/SOM-st/TruffleSOM.git

Then, TruffleSOM can be build with Ant:

ant jar

Afterwards, the tests can be executed with:

./som -cp Smalltalk TestSuite/TestHarness.som

A simple Hello World program is executed with:

./som -cp Smalltalk Examples/Hello.som

When working on TruffleSOM, for instance in Eclipse, it is helpful to download the source files for Truffle as well:

ant develop

Information on previous authors are included in the AUTHORS file. This code is distributed under the MIT License. Please see the LICENSE file for details.

TruffleSOM Implementation

TruffleSOM implements a file-based Smalltalk with most of the language features common to other Smalltalks. This includes support for objects, classes, methods, closures/blocks/lambdas, non-local returns, and typical reflective operations, e.g., method invocation or object field access.

The implementation of TruffleSOM is about 3500 lines of code in size and is a concise but comprehensive example for how to use the Truffle framework to implement standard language features.

Its parser creates a custom AST that is geared towards representing the executable semantics. Thus, we did not include AST nodes that have structural purpose only. Instead, we concentrated on the AST nodes that are relevant to express Smalltalk language semantics.

Currently TruffleSOM demonstrates for instance:

Build Status

Thanks to Travis CI, all commits of this repository are tested. The current build status is: Build Status