Embedding and Parsing Combined for Efficient Language Design

Gergely Dévai, Dániel Leskó, Máté Tejfel


One way to develop domain specific languages is to define their concrete syntax and create support for it using classical compiler technology (maybe with the support of language workbenches). A different way is to create an embedded language, which is implemented as a special library written in a host language. The first approach is usually too costly in the first phase of the language design when the language evolves and changes quickly. Embedded languages are more lightweight and support the language experiments better. On the other hand, they are not that convenient for the end-users as the standalone languages. This paper presents the lessons learnt from a DSL development research project in industry-university cooperation, that combined the advantages of the two approaches: the flexibility of embedding in the design phase and the convenience of a standalone language in the final product.


  1. Axelsson, E., Claessen, K., Dévai, G., Horváth, Z., Keijzer, K., Persson, A., Sheeran, M., Svenningsson, J., Vajda, A., and et al. (2010). Feldspar: A domain specific language for digital signal processing algorithms. In IN: Proc. 8th ACM/IEEE International Conference on Formal Methods and Models for Codesign. IEEE.
  2. Bravenboer, M., Groot, R. D., and Visser, E. (2005). Metaborg in action: Examples of domain-specific language embedding and assimilation using stratego/xt. In In Participants Proceedings of the Summer School on Generative and Transformational Techniques in Software Engineering (GTTSE05. Springer Verlag.
  3. Bravenboer, M. and Visser, E. (2004). Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions. SIGPLAN Not., 39(10):365-383.
  4. Cleenewerck, T. (2003). Component-based dsl development. In In Proceedings of GPCE03 Conference, Lecture Notes in Computer Science 2830, pages 245-264. Springer-Verlag.
  5. Cunningham, H. C. (2008). A little language for surveys: constructing an internal dsl in ruby. In Proceedings of the 46th Annual Southeast Regional Conference on XX, ACM-SE 46, pages 282-287, New York, NY, USA. ACM.
  6. Czarnecki, K., O'Donnell, J. T., Striegnitz, J., and Taha, W. (2003). Dsl implementation in metaocaml, template haskell, and c++. In Domain-Specific Program Generation, pages 51-72.
  7. Dévai, G., Tejfel, M., Gera, Z., Páli, G., Nagy, G., Horváth, Z., Axelsson, E., Sheeran, M., Vajda, A., Lyckega°rd, B., and Persson, A. (2010). Efficient code generation from the high-level domain-specific language Feldspar for DSPs. In ODES-8: 8th Workshop on Optimizations for DSP and Embedded Systems.
  8. Freeman, S. and Pryce, N. (2006). Evolving an Embedded Domain-Specific Language in Java. In Companion to the 21st ACM SIGPLAN Conference. OOPSLA'06, pages 855-865, Portland, Oregon, USA.
  9. Leijen, D. and Meijer, E. (2001). Parsec: Direct style monadic parser combinators for the real world. Electronic Notes in Theoretical Computer Science, 41(1).
  10. Sloane, A. M. (2009). Experiences with Domain-Specific Language Embedding in Scala.
  11. Spinellis, D. (2001). Notable design patterns for domainspecific languages. J. Syst. Softw., 56(1):91-99.
  12. Wadler, P. (1992). Wadler's ”Law” on guage design. Haskell mailing http://code.haskell.org/˜dons/haskell-1990- 2000/msg00737.html.
  13. Wile, D. (2004). Lessons learned from real dsl experiments. Sci. Comput. Program., 51(3):265-290.
  14. Zdun, U. (2010). A dsl toolkit for deferring architectural decisions in dsl-based software design. Information and Software Technology, Vol.52(No. 7):733-748.

Paper Citation

in Harvard Style

Dévai G., Leskó D. and Tejfel M. (2013). Embedding and Parsing Combined for Efficient Language Design . In Proceedings of the 8th International Joint Conference on Software Technologies - Volume 1: ICSOFT-EA, (ICSOFT 2013) ISBN 978-989-8565-68-6, pages 244-250. DOI: 10.5220/0004591802440250

in Bibtex Style

author={Gergely Dévai and Dániel Leskó and Máté Tejfel},
title={Embedding and Parsing Combined for Efficient Language Design},
booktitle={Proceedings of the 8th International Joint Conference on Software Technologies - Volume 1: ICSOFT-EA, (ICSOFT 2013)},

in EndNote Style

JO - Proceedings of the 8th International Joint Conference on Software Technologies - Volume 1: ICSOFT-EA, (ICSOFT 2013)
TI - Embedding and Parsing Combined for Efficient Language Design
SN - 978-989-8565-68-6
AU - Dévai G.
AU - Leskó D.
AU - Tejfel M.
PY - 2013
SP - 244
EP - 250
DO - 10.5220/0004591802440250