A simple language built using Truffle for the GraalVM
Clone or download
Pull request Compare This branch is 155 commits behind graalvm:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.externalToolBuilders
.settings
src
tests
.classpath
.factorypath
.gitignore
.project
.travis.yml
CONTRIBUTING.md
LICENSE.md
README.md
build
pom.xml
sl

README.md

SimpleLanguage

A simple language built using Truffle for the GraalVM.

SimpleLanguage is heavily documented to explain the how and why of writing a Truffle language. A good way to read this documentation is to generate HTML of the JavaDoc comments and read that, and then read the source alongside the comments.

This repository is licensed under the permissive UPL licence. Fork it to begin your own Truffle language.

Prerequisites

  • JDK 8
  • maven3
  • Eclipse (optional)

Installation

  • Clone SL repository using git clone https://github.com/graalvm/simplelanguage
  • Download Graal VM Development Kit from http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads
  • Unpack the downloaded graalvm_*.tar.gz into simplelanguage/graalvm.
  • Verify that the file simplelanguage/graalvm/bin/java exists and is executable
  • Execute ./build (which just runs mvn package)

Eclipse

  • Create a new workspace
  • File -> Import... -> Existing Project into Workspace -> Select simplelanguage folder -> Finish

Running

  • Execute ./sl tests/HelloWorld.sl to run a simple language source file.
  • Execute ./sl -disassemble tests/LoopSum.sl to see assembly code for Truffle compiled functions.

IGV

Debugging

  • Execute ./sl -debug tests/HelloWorld.sl.
  • Attach a Java remote debugger (like Eclipse) on port 8000.

Further information