Implementing a New Language with Truffle

The Truffle framework enables you to implement a programming language and run it efficiently on GraalVM. We provide extensive Truffle API documentation.

A good way to start implementing your language is to:

  • Look at the TruffleLanguage class, and subclass it for your own language implementation.
  • Fork the SimpleLanguage project and start hacking. SimpleLanguage is a relatively small language implementation, well-documented, and designed to demonstrate most of the Truffle features.
  • Examine the GraalVM Polyglot API that enables you to embed your Truffle language in Java.

We also recommend to watch this online seminar on Dynamic Metacompilation with Truffle by Christian Humer from Oracle, to better understand Truffle concepts such as dynamic metacompilation, partial evaluation, polymorphic inlining, and so on.

Connect with us