Language Boxes

Bending the Host Language with Modular Language Changes
  • Lukas Renggli
  • Marcus Denker
  • Oscar Nierstrasz
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5969)


As domain-specific modeling begins to attract widespread acceptance, pressure is increasing for the development of new domain-specific languages. Unfortunately these DSLs typically conflict with the grammar of the host language, making it difficult to compose hybrid code except at the level of strings; few mechanisms (if any) exist to control the scope of usage of multiple DSLs; and, most seriously, existing host language tools are typically unaware of the DSL extensions, thus hampering the development process. Language boxes address these issues by offering a simple, modular mechanism to encapsulate (i) compositional changes to the host language, (ii) transformations to address various concerns such as compilation and syntax highlighting, and (iii) scoping rules to control visibility of fine-grained language extensions. We describe the design and implementation of language boxes, and show with the help of several examples how modular extensions can be introduced to a host language and environment.


Regular Expression Structure Query Language Language Feature Grammar Rule Language Extension 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Fowler, M.: Domain specific languages. Work In Progress (June 2008)
  2. 2.
    Bracha, G.: Executable grammars in Newspeak. Electron. Notes Theor. Comput. Sci. 193, 3–18 (2007)CrossRefGoogle Scholar
  3. 3.
    Goldberg, A., Robson, D.: Smalltalk 80: the Language and its Implementation. Addison Wesley, Reading (1983)zbMATHGoogle Scholar
  4. 4.
    Black, A., Ducasse, S., Nierstrasz, O., Pollet, D., Cassou, D., Denker, M.: Pharo by Example. Square Bracket Associates (2009)Google Scholar
  5. 5.
    Denker, M., Ducasse, S., Lienhard, A., Marschall, P.: Sub-method reection. In: Journal of Object Technology, Special Issue. Proceedings of TOOLS Europe 2007, ETH, vol. 6/9, pp. 231–251 (2007)Google Scholar
  6. 6.
    Renggli, L., Gîrba, T.: Why Smalltalk wins the host languages shootout. In: Proceedings of International Workshop on Smalltalk Technologies (IWST 2009). ACM Digital Library, New York (to appear, 2009)Google Scholar
  7. 7.
    Visser, E.: Scannerless generalized-LR parsing. Technical Report P9707, Programming Research Group, University of Amsterdam (July 1997)Google Scholar
  8. 8.
    Hutton, G., Meijer, E.: Monadic parser combinators. Technical Report NOTTCSTR- 96-4, Department of Computer Science, University of Nottingham (1996)Google Scholar
  9. 9.
    Ford, B.: Parsing expression grammars: a recognition-based syntactic foundation. In: POPL 2004: Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 111–122. ACM, New York (2004)CrossRefGoogle Scholar
  10. 10.
    Ford, B.: Packrat parsing: simple, powerful, lazy, linear time, functional pearl. In: ICFP 2002: Proceedings of the seventh ACM SIGPLAN international conference on Functional programming, vol. 37/9, pp. 36–47. ACM, New York (2002)CrossRefGoogle Scholar
  11. 11.
    Foote, B., Johnson, R.E.: Reective facilities in Smalltalk-80. In: Proceedings OOPSLA 1989, October 1989. ACM SIGPLAN Notices, vol. 24, pp. 327–336 (1989)Google Scholar
  12. 12.
    Bawden, A.: Quasiquotation in Lisp. In: Partial Evaluation and Semantic-Based Program Manipulation, pp. 4–12 (1999)Google Scholar
  13. 13.
    Taha, W.: A gentle introduction to multi-stage programming. In: Domain-Specific Program Generation, pp. 30–50 (2003)Google Scholar
  14. 14.
    Tratt, L.: The Converge programming language. Technical Report TR-05-01, Department of Computer Science, King’s College London (February 2005)Google Scholar
  15. 15.
    Clark, T., Sammut, P., Willans, J.: Superlanguages, Developing Languages and Applications with XMF, vol. 1st edn. Ceteva (2008)Google Scholar
  16. 16.
    Seaton, C.: A programming language where the syntax and semantics are mutable at runtime. Technical Report CSTR-07-005, University of Bristol (June 2007)Google Scholar
  17. 17.
    Klint, P.: A meta-environment for generating programming environments. ACM Transactions on Software Engineering and Methodology (TOSEM) 2(2), 176–201 (1993)CrossRefGoogle Scholar
  18. 18.
    Fowler, M.: Language workbenches: The killer-app for domain-specific languages (June 2005),
  19. 19.
    Cordy, J.R.: The TXL source transformation language. Sci. Comput. Program. 61(3), 190–210 (2006)CrossRefMathSciNetzbMATHGoogle Scholar
  20. 20.
    Bravenboer, M., Visser, E.: Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In: Schmidt, D.C. (ed.) Proceedings of the 19th ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA 2004), Vancouver, Canada, pp. 365–383. ACM Press, New York (2004)CrossRefGoogle Scholar
  21. 21.
    Visser, E.: Program transformation with Stratego/XT: Rules, strategies, tools, and systems in StrategoXT-0.9. In: Lengauer, C., Batory, D., Consel, C., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 216–238. Springer, Heidelberg (2004)Google Scholar
  22. 22.
    Krahn, H., Rumpe, B., Völkel, S.: MontiCore: Modular development of textual domain specific languages. In: Paige, R., Meyer, B. (eds.) Proceedings of the 46th International Conference Objects, Models, Components, Patterns (TOOLS-Europe), pp. 297–315. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  23. 23.
    Spinellis, D.: Notable design patterns for domain specific languages. Journal of Systems and Software 56(1), 91–99 (2001)CrossRefGoogle Scholar
  24. 24.
    Cleenewerck, T.: Component-based DSL development. In: Proceedings of the 2nd international conference on Generative programming and component engineering, pp. 245–264. Springer, New York (2003)Google Scholar
  25. 25.
    Van Wyk, E., de Moor, O., Backhouse, K., Kwiatkowski, P.: Forwarding in Attribute Grammars for Modular Language Design. In: Horspool, R.N. (ed.) CC 2002. LNCS, vol. 2304, pp. 128–142. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  26. 26.
    Van Wyk, E., Krishnan, L., Bodin, D., Schwerdfeger, A.: Attribute Grammar-Based Language Extensions for Java. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 575–599. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  27. 27.
    Hudak, P.: Building domain specific embedded languages. ACM Computing Surveys 28(4es) (December 1996)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Lukas Renggli
    • 1
  • Marcus Denker
    • 2
  • Oscar Nierstrasz
    • 1
  1. 1.Software Composition GroupUniversity of BernSwitzerland
  2. 2.PLEIADUniversity of ChileSantiagoChile

Personalised recommendations