Skip to main navigation Skip to search Skip to main content

A domain-specific language for building self-optimizing AST interpreters

  • Christian Humer
  • , Christian Wimmer
  • , Christian Wirth
  • , Andreas Wöß
  • , Thomas Würthinger

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

Abstract

Self-optimizing AST interpreters dynamically adapt to the provided input for faster execution. This adaptation includes initial tests of the input, changes to AST nodes, and insertion of guards that ensure assumptions still hold. Such specialization and speculation is essential for the performance of dynamic programming languages such as JavaScript. In traditional procedural and objectoriented programming languages it can be tedious to write selfoptimizing AST interpreters, as those languages fail to provide constructs that would specifically support that. This paper introduces a declarative domain-specific language (DSL) that greatly simplifies writing self-optimizing AST interpreters. The DSL supports specialization of operations based on types of the input and other properties. It can then use these specializations directly or chain them to represent the operation with the minimum amount of code possible. The DSL significantly reduces the complexity of expressing specializations for those interpreters. We use it in our high-performance implementation of JavaScript, where 274 language operations have an average of about 4 and a maximum of 190 specializations. In addition, the DSL is used in implementations of Ruby, Python, R, and Smalltalk.
Original languageEnglish
Title of host publicationProceeding GPCE 2014 Proceedings of the 2014 International Conference on Generative Programming: Concepts and Experiences
PublisherACM New York
Pages123-132
Number of pages10
ISBN (Electronic)9781450331616
ISBN (Print)978-1-4503-3161-6
DOIs
Publication statusPublished - 15 Sept 2014

Fields of science

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

JKU Focus areas

  • Computation in Informatics and Mathematics
  • Engineering and Natural Sciences (in general)

Cite this