Implementing multi-stage languages using ASTs, Gensym, and reflection

  • Authors:
  • Cristiano Calcagno;Walid Taha;Liwen Huang;Xavier Leroy

  • Affiliations:
  • Imperial College London, UK;Rice University, Houston, TX;Yale University, New Haven, CT;INRIA, Roquencourt, France

  • Venue:
  • Proceedings of the 2nd international conference on Generative programming and component engineering
  • Year:
  • 2003

Quantified Score

Hi-index 0.02

Visualization

Abstract

The paper addresses theoretical and practical aspects of implementing multi-stage languages using abstract syntax trees (ASTs), gensym, and reflection. We present an operational account of the correctness of this approach, and report on our experience with a bytecode compiler called MetaOCaml that is based on this strategy. Current performance measurements reveal interesting characteristics of the underlying OCaml compiler, and illustrate why this strategy can be particularly useful for implementing domain-specific languages in a typed, functional setting.