Polymorphic embedding of dsls

  • Authors:
  • Christian Hofer;Klaus Ostermann;Tillmann Rendel;Adriaan Moors

  • Affiliations:
  • University of Aarhus, Aarhus, Denmark;University of Aarhus, Aarhus, Denmark;University of Aarhus, Aarhus, Denmark;Katholieke Universiteit Leuven, Leuven, Belgium

  • Venue:
  • GPCE '08 Proceedings of the 7th international conference on Generative programming and component engineering
  • Year:
  • 2008

Quantified Score

Hi-index 0.02

Visualization

Abstract

The influential pure embedding methodology of embedding domain-specific languages (DSLs) as libraries into a general-purpose host language forces the DSL designer to commit to a single semantics. This precludes the subsequent addition of compilation, optimization or domain-specific analyses. We propose polymorphic embedding of DSLs, where many different interpretations of a DSL can be provided as reusable components, and show how polymorphic embedding can be realized in the programming language Scala. With polymorphic embedding, the static type-safety, modularity, composability and rapid prototyping of pure embedding are reconciled with the flexibility attainable by external toolchains.