DSL Implementation in MetaOCaml, Template Haskell, and C++

TitleDSL Implementation in MetaOCaml, Template Haskell, and C++
Publication TypeBook Chapter
Year of Publication2003
AuthorsCzarnecki, K., T. O'Donnell, John, J. Striegnitz, and W. Taha
Book TitleDomain-Specific Program Generation, International Seminar, Dagstuhl Castle, Germany, March 23-28, 2003, Revised Papers
Series TitleLecture Notes in Computer Science
CityBerlin, Heidelberg

A wide range of domain-specific languages (DSLs) has been implemented
successfully by embedding them in general purpose lan- guages. This
paper reviews embedding, and summarizes how two alternative techniques
– staged interpreters and templates – can be used to overcome the
limitations of embedding. Both techniques involve a form of generative
programming. The paper reviews and compares three pro- gramming
languages that have special support for generative programming. Two of
these languages (MetaOCaml and Template Haskell) are research
languages, while the third (C++) is already in wide industrial use.
The paper identifies several dimensions that can serve as a basis for
comparing generative languages.