License: Creative Commons Attribution 4.0 International license (CC BY 4.0)
When quoting this document, please refer to the following
DOI: 10.4230/OASIcs.EVCS.2023.16
URN: urn:nbn:de:0030-drops-177865
URL: http://dagstuhl.sunsite.rwth-aachen.de/volltexte/2023/17786/
Koppel, James
Typed Multi-Language Strategy Combinators
Abstract
Strategy combinators (also called strategic programming) are a technique for modular program transformation construction invented by Bas Luttik and Eelco Visser, best known for their instantiation in the Stratego language. Traditional implementations are dynamically typed, and struggle to represent transformations that can be usefully applied to some types, but not all.
We present the design of our strategy-combinator library compstrat, a library for type-safe strategy combinators which run on Patrick Bahr’s compositional datatypes. We show how strategy combinators and compositional datatypes fuse elegantly, allowing the creation of type-preserving program transformations which operate only on datatypes satisfying certain properties. With this technique, it becomes possible to compactly define program transformations that operate on multiple programming languages. compstrat is part of the Cubix framework and has been used to build four program transformations, each of which operates on at least three languages.
BibTeX - Entry
@InProceedings{koppel:OASIcs.EVCS.2023.16,
author = {Koppel, James},
title = {{Typed Multi-Language Strategy Combinators}},
booktitle = {Eelco Visser Commemorative Symposium (EVCS 2023)},
pages = {16:1--16:9},
series = {Open Access Series in Informatics (OASIcs)},
ISBN = {978-3-95977-267-9},
ISSN = {2190-6807},
year = {2023},
volume = {109},
editor = {L\"{a}mmel, Ralf and Mosses, Peter D. and Steimann, Friedrich},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/opus/volltexte/2023/17786},
URN = {urn:nbn:de:0030-drops-177865},
doi = {10.4230/OASIcs.EVCS.2023.16},
annote = {Keywords: program transformation, strategic programming}
}