M. Grebe, D. Young, and A. Gill, “Rewriting a shallow dsl using a ghc compiler extension,” in Proceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences, GPCE 2017, (New York, NY, USA), pp. 246–258, ACM, 2017.
Links
Abstract
Embedded Domain Specific Languages are a powerful tool for
developing customized languages to fit specific problem domains.
Shallow EDSLs allow a programmer to program using many of
the features of a host language and its syntax, but sacrifice
performance. Deep EDSLs provide better performance
and flexibility, through the ability to manipulate the
abstract syntax tree of the DSL program, but sacrifice
syntactical similarity to the host language. Using Haskino,
an EDSL designed for small embedded systems based on
the Arduino line of microcontrollers, and a compiler plugin
for the Haskell GHC compiler, we show a method
for combining the best aspects of shallow and deep EDSLs.
The programmer is able to write in the shallow EDSL, and
have it automatically transformed into the deep EDSL. This
allows the EDSL user to benefit from powerful aspects
of the host language, Haskell, while meeting the demanding
resource constraints of the small embedded processing
environment.
BibTeX
@inproceedings{Grebe:2017:RSD:3136040.3136048, author = {Grebe, Mark and Young, David and Gill, Andy}, title = {Rewriting a Shallow DSL Using a GHC Compiler Extension}, booktitle = {Proceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences}, series = {GPCE 2017}, year = {2017}, isbn = {978-1-4503-5524-7}, location = {Vancouver, BC, Canada}, pages = {246--258}, numpages = {13}, doi = {10.1145/3136040.3136048}, acmid = {3136048}, publisher = {ACM}, address = {New York, NY, USA}, keywords = {Arduino, EDSL, GHC, Haskell, Transformations}, }