We present Truffle, a novel open-source framework for implementing managed languages in Java. The language implementer writes an AST interpreter. It uses our framework that allows tree rewriting during AST interpretation. Tree rewrites incorporate type feedback and other profiling information into the tree, thus specializing the tree and augmenting it with run-time information. When the tree reaches a stable state, partial evaluation compiles the tree into optimized machine code. The partial evaluation is done by Graal, the just-in-time compiler of our version of the Java HotSpot VM.
This tutorial is both for newcomers and existing users of Truffle. We introduce the basic concepts of Truffle and show you how to get started with your own high-performance language implementation. And we present recently added features of Truffle, for example, a language-independent object model; and the API to perform guest-language stack walking and local variable introspection without losing performance.
Christian Wimmer is a researcher at Oracle Labs, working on the Maxine VM, the Graal compiler, the Truffle dynamic language infrastructure, as well as on other projects that involve dynamic compilation and optimizations. His research interests span from compilers, virtual machines, and secure systems to component-based software architectures. He received a Dr. techn. degree in computer science (advisor: Prof. Hanspeter Moessenboeck) from the Johannes Kepler University Linz, Austria. Before joining Oracle, he was a postdoctoral researcher at the Department of Computer Science of the University of California, Irvine, working with Prof. Michael Franz. Christian has been working on Truffle and Graal since the beginning of the projects.