An evaluation of a pure embedded domain-specific language for strategic term rewriting

Research output: Chapter in Book/Report/Conference proceedingChapterpeer-review

1 Citation (Scopus)


Domain-specific languages are often implemented by embedding them in general-purpose programming languages. The Kiama library used in this chapter for the Scala programming language contains a rewriting component that is an embedded implementation of the Stratego term rewriting language. The authors evaluate the trade-offs inherent in this approach and its practicality via a non-trivial case study. An existing Stratego implementation of a compiler for the Apply image processing language was translated into a Kiama implementation. The chapter examines the linguistic differences between the two versions of the Stratego domain-specific language, and compares the size, speed, and memory usage of the two Apply compiler implementations. The authors' experience shows that the embedded language implementation inflicts constraints that mean a precise duplication of Stratego is impossible, but the main flavor of the language is preserved. The implementation approach allows for writing code of similar size, but imposes a performance penalty. Nevertheless, the performance is still at a practically useful level and scales for large inputs in the same way as the Stratego implementation.

Original languageEnglish
Title of host publicationFormal and Practical Aspects of Domain-Specific Languages
Subtitle of host publicationRecent Developments
EditorsMarjan Mernik
Place of PublicationHershey, PA
PublisherIGI Global
Number of pages28
ISBN (Electronic)9781466620933
ISBN (Print)9781466620926, 1466620927
Publication statusPublished - 2013


Dive into the research topics of 'An evaluation of a pure embedded domain-specific language for strategic term rewriting'. Together they form a unique fingerprint.

Cite this