Abstract
Language embedding is a method to implement a new language within the framework of an existing programming language. This method is known to speed up the development process compared to standalone languages using classical compiler technology. On the other hand, embedded languages may not be that convenient for the end-users as standalone ones with own concrete syntax. This paper describes a method that uses the flexibility of language embedding in the experimental phase of the language design process, then, once the language features are mature enough, adds concrete syntax and turns the language to a standalone one. Lessons learnt from a project, run in industry-university cooperation and using the presented method, are discussed. Based on these results, a cost model is established that can be used to estimate the potential benefits of this method in case of future language design projects.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
In this project we have been using Subversion.
- 2.
Note that this project was entirely implemented in Haskell, which allows much more concise code than the mainstream imperative, object oriented languages.
- 3.
We have been using the Parsec parser combinator library [10] of Haskell. Using context free grammars instead would have resulted in similar code size.
- 4.
“Wadler’s Law: The emotional intensity of debate on a language feature increases as one moves down the following scale: Semantics, Syntax, Lexical syntax, Comments.” (Philiph Wadler in the Haskell mailing list, February 1992, see [13].)
- 5.
The unit of measure can be anything from files to characters. Our statistics use lines.
References
Axelsson, E., Claessen, K., Dévai, G., Horváth, Z., Keijzer, K., Persson, A., Sheeran, M., Svenningsson, J., Vajda, A., et al.: Feldspar: a domain specific language for digital signal processing algorithms. In: Proceedings of the 8th ACM/IEEE International Conference on Formal Methods and Models for Codesign. IEEE (2010)
Bierhoff, K., Liongosari, E.S., Swaminathan, K.S.: Incremental development of a domain-specific language that supports multiple application styles. In: OOPSLA 6th Workshop on Domain Specific Modeling, pp. 67–78 (2006)
Bravenboer, M., de Groot, R., Visser, E.: MetaBorg in action: examples of domain-specific language embedding and assimilation using Stratego/XT. In: Lämmel, R., Saraiva, J., Visser, J. (eds.) GTTSE 2005. LNCS, vol. 4143, pp. 297–311. Springer, Heidelberg (2006)
Bravenboer, M., Visser, E.: Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions. SIGPLAN Not. 39(10), 365–383 (2004). http://doi.acm.org/10.1145/1035292.1029007
Cleenewerck, T.: Component-based DSL development. In: Pfenning, F., Macko, M. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 245–264. Springer, Heidelberg (2003)
Cunningham, H.C.: 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, pp. 282–287. ACM, New York (2008). http://doi.acm.org/10.1145/1593105.1593181
Czarnecki, K., O’Donnell, J.T., Striegnitz, J., Taha, W.: DSL implementation in MetaOCaml, Template Haskell, and C++. In: Lengauer, C., Batory, D., Blum, A., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 51–72. Springer, Heidelberg (2004)
Dévai, G., Tejfel, M., Gera, Z., Páli, G., Nagy, G., Horváth, Z., Axelsson, E., Sheeran, M., Vajda, A., Lyckegård, B., Persson, A.: 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 (2010)
Freeman, S., Pryce, N.: Evolving an embedded domain-specific language in Java. In: Companion to the 21st ACM SIGPLAN Conference. OOPSLA’06, pp. 855–865, Portland, Oregon, USA (2006). http://www.mockobjects.com/files/evolving_an_edsl.ooplsa2006.pdf
Leijen, D., Meijer, E.: Parsec: Direct style monadic parser combinators for the real world. Electron. Notes Theoret. Comput. Sci. 41(1) (2001). Technical Report UU-CS-2001-35
Sloane, A.M.: Experiences with domain-specific language embedding in Scala. In: Lawall, J., Réveillére, L. (eds.) International Workshop on Domain-Specific Program Development (DSDP), Nashville, Tennessee, USA. vol. 7 (2008)
Spinellis, D.: Notable design patterns for domain-specific languages. J. Syst. Softw. 56(1), 91–99 (2001). http://dx.doi.org/10.1016/S0164-1212(00)00089-3
Wadler, P.: Wadler’s “Law” on language design. Haskell mailing list (1992). http://code.haskell.org/~dons/haskell-1990-2000/msg00737.html
Wile, D.: Lessons learned from real DSL experiments. Sci. Comput. Program. 51(3), 265–290 (2004). http://dx.doi.org/10.1016/j.scico.2003.12.006
Zdun, U.: A DSL toolkit for deferring architectural decisions in DSL-based software design. Inf. Softw. Technol. 52(7), 733–748 (2010). http://eprints.cs.univie.ac.at/2288/
Acknowledgements
We would like to thank the support of Ericsson Hungary and the grant EITKIC 12-1-2012-0001 that is supported by the Hungarian Government, managed by the National Development Agency, and financed by the Research and Technology Innovation Fund.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Dévai, G., Leskó, D., Tejfel, M. (2014). Language Design and Implementation via the Combination of Embedding and Parsing. In: Cordeiro, J., van Sinderen, M. (eds) Software Technologies. ICSOFT 2013. Communications in Computer and Information Science, vol 457. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-44920-2_9
Download citation
DOI: https://doi.org/10.1007/978-3-662-44920-2_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-662-44919-6
Online ISBN: 978-3-662-44920-2
eBook Packages: Computer ScienceComputer Science (R0)