Self-optimizing AST interpreters

Thomas Würthinger, Andreas Wöß, Lukas Stadler, Gilles Marie Duboscq, Simon Doug, Christian Wimmer

Research output: Chapter in Book/Report/Conference proceedingConference proceedingspeer-review

Abstract

An abstract syntax tree (AST) interpreter is a simple and natural way to implement a programming language. However, it is also considered the slowest approach because of the high overhead of virtual method dispatch. Language implementers therefore define bytecodes to speed up interpretation, at the cost of introducing inflexible and hard to maintain bytecode formats. We present a novel approach to implementing AST interpreters in which the AST is modified during interpretation to incorporate type feedback. This tree rewriting is a general and powerful mechanism to optimize many constructs common in dynamic programming languages. Our system is implemented in Java and uses the static typing and primitive data types of Java elegantly to avoid the cost of boxed representations of primitive values in dynamic programming languages.
Original languageEnglish
Title of host publicationDLS '12 Proceedings of the 8th symposium on Dynamic languages
PublisherACM
Pages73-82
Number of pages10
ISBN (Print)978-1-4503-1564-7
Publication statusPublished - 2012

Fields of science

  • 102 Computer Sciences
  • 102009 Computer simulation
  • 102011 Formal languages
  • 102013 Human-computer interaction
  • 102029 Practical computer science
  • 102022 Software development
  • 102024 Usability research

JKU Focus areas

  • Computation in Informatics and Mathematics

Cite this