Brussels / 31 January & 1 February 2015


Zero-Overhead Metaprogramming

Using Self-optimizing Interpreters to make Runtime Metaprogramming Fast

Runtime metaprogramming enables many useful applications and is widely used in frameworks, middleware, and domain-specific languages to simplify the task of application developers. However, today’s language implementations rarely optimize even common concepts such as reflective method invocation or dynamic proxies, despite the fact that solutions for efficient implementations have been advocated since decades.

In this presentation, we demonstrate how self-optimizing interpreters can be used to implement runtime metaprogramming efficiently. For the implementation, we use SOM Smalltalk, a little Smalltalk implemented in RPython (think PyPy) as well as Truffle (with Graal on top of the JVM). We show that both platforms can remove the runtime overhead of reflection and thus open up new opportunities for metaprogramming in performance critical scenarios.


Photo of Stefan Marr Stefan Marr