Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Language Design and Implementation via the Combination of Embedding and Parsing

  • Conference paper
  • First Online:
Software Technologies (ICSOFT 2013)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 457))

Included in the following conference series:

  • 520 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    In this project we have been using Subversion.

  2. 2.

    Note that this project was entirely implemented in Haskell, which allows much more concise code than the mainstream imperative, object oriented languages.

  3. 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. 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. 5.

    The unit of measure can be anything from files to characters. Our statistics use lines.

References

  1. 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)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. 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)

    Google Scholar 

  4. 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

  5. Cleenewerck, T.: Component-based DSL development. In: Pfenning, F., Macko, M. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 245–264. Springer, Heidelberg (2003)

    Google Scholar 

  6. 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

  7. 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)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. 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

  10. 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

    Google Scholar 

  11. 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)

    Google Scholar 

  12. 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

  13. Wadler, P.: Wadler’s “Law” on language design. Haskell mailing list (1992). http://code.haskell.org/~dons/haskell-1990-2000/msg00737.html

  14. 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

  15. 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/

Download references

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

Authors

Corresponding author

Correspondence to Gergely Dévai .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics