Chapter

A List of Successes That Can Change the World

Volume 9600 of the series Lecture Notes in Computer Science pp 318-335

Date:

The Essence of Multi-stage Evaluation in LMS

* Final gross prices may vary according to local VAT.

Get Access

Abstract

Embedded domain-specific languages (DSLs) are the subject of wide-spread interest, and a variety of implementation techniques exist. Some of them have been invented, and some of them discovered. Many are based on a form of generative or multi-stage programming, where the host language program builds up DSL terms during its evaluation. In this paper, we examine the execution model of LMS (Lightweight Modular Staging), a framework for embedded DSLs in Scala, and link it to evaluation in a two-stage lambda calculus. This clarifies the semantics of certain ad-hoc implementation choices, and provides guidance for implementing similar multi-stage evaluation facilities in other languages.

Keywords

Multi-stage programming Scala Domain-specific languages LMS (Lightweight Modular Staging) Partial evaluation