Abstract
Domain-specific languages (DSLs) are increasingly used as embedded languages within general-purpose host languages. DSLs provide a compact, dedicated syntax for specifying parts of an application related to specialized domains. Unfortunately, such language extensions typically do not integrate well with the development tools of the host language. Editors, compilers and debuggers are either unaware of the extensions, or must be adapted at a non-trivial cost. We present a novel approach to embed DSLs into an existing host language by leveraging the underlying representation of the host language used by these tools. Helvetia is an extensible system that intercepts the compilation pipeline of the Smalltalk host language to seamlessly integrate language extensions. We validate our approach by case studies that demonstrate three fundamentally different ways to extend or adapt the host language syntax and semantics.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Fowler, M.: FluentInterface, on Martin Fowler’s blog (December 2005), http://www.martinfowler.com/bliki/FluentInterface.html
Fowler, M.: Language workbenches: The killer-app for domain-specific languages (June 2005), http://www.martinfowler.com/articles/languageWorkbench.html
Mernik, M., Heering, J., Sloane, A.M.: When and how to develop domain-specific languages. ACM Comput. Surv. 37(4), 316–344 (2005)
Hudak, P.: Building domain specific embedded languages. ACM Computing Surveys 28(4es) (December 1996)
Spinellis, D.: Notable design patterns for domain specific languages. Journal of Systems and Software 56(1), 91–99 (2001)
Renggli, L., Denker, M., Nierstrasz, O.: Language boxes: Bending the host language with modular language changes. In: Software Language Engineering: Second International Conference, SLE 2009, Denver, Colorado, October 5-6. LNCS. Springer, Heidelberg (2009) (to appear)
Sheard, T.: Accomplishments and research challenges in meta-programming. In: Taha, W. (ed.) SAIG 2001. LNCS, vol. 2196, pp. 2–44. Springer, Heidelberg (2001)
Gybels, K., Wuyts, R., Ducasse, S., D’Hondt, M.: Inter-language reflection — a conceptual model and its implementation. Journal of Computer Languages, Systems and Structures 32(2-3), 109–124 (2006)
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, p. 575. Springer, Heidelberg (2007)
Kats, L.C.L., Bravenboer, M., Visser, E.: Mixing source and bytecode. A case for compilation by normalization. In: Kiczales, G. (ed.) Proceedings OOPSLA 2008, Nashville, Tenessee, USA, pp. 91–108. ACM, New York (October 2008)
Ekman, T., Hedin, G.: The JastAdd extensible Java compiler. In: Gabriel, R.P., Bacon, D.F., Lopes, C.V., Steele Jr., G.L. (eds.) Proceedings OOPSLA 2007, pp. 1–18. ACM, New York (2007)
Nystrom, N., Clarkson, M.R., Myers, A.C.: Polyglot: An extensible compiler framework for java. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 138–152. Springer, Heidelberg (2003)
Cox, R., Bergan, T., Clements, A.T., Kaashoek, F., Kohler, E.: Xoc, an extension-oriented compiler for systems programming. SIGARCH Comput. Archit. News 36(1), 244–254 (2008)
Piumarta, I., Warth, A.: Open reusable object models. Technical report, Viewpoints Research Institute, VPRI Research Note RN-2006-003-a (2006)
Warth, A., Piumarta, I.: OMeta: an object-oriented language for pattern matching. In: DLS 2007: Proceedings of the 2007 symposium on Dynamic languages, pp. 11–19. ACM, New York (2007)
Tratt, L.: The Converge programming language. Technical Report TR-05-01, Department of Computer Science, King’s College London (February 2005)
Calcagno, C., Taha, W., Huang, L., Leroy, X.: Implementing multi-stage languages using ASTs, GenSym, and Reflection. In: Pfenning, F., Smaragdakis, Y. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 57–76. Springer, Heidelberg (2003)
Dimitriev, S.: Language oriented programming: The next programming paradigm. On Board Online Magazine 1(1) (November 2004)
Simonyi, C., Christerson, M., Clifford, S.: Intentional software. In: Proceedings OOPSLA 2006, pp. 451–464. ACM, New York (2006)
Solmi, R.: Whole Platform. PhD thesis, University of Bologna (March 2005)
Charles, P., Fuhrer, R.M., Sutton Jr., S.M., Duesterwald, E., Vinju, J.J.: Accelerating the creation of customized, language-specific ides in eclipse. In: Arora, S., Leavens, G.T. (eds.) Proceedings OOPSLA 2009, pp. 191–206. ACM, New York (2009)
Seaton, C.: A programming language where the syntax and semantics are mutable at runtime. Technical Report CSTR-07-005, University of Bristol (June 2007)
Clark, T., Sammut, P., Willans, J.: Superlanguages, Developing Languages and Applications with XMF. 1st edn., Ceteva (2008)
Faith, R.E., Nyland, L.S., Prins, J.F.: KHEPERA: a system for rapid implementation of domain specific languages. In: DSL 1997: Proceedings of the Conference on Domain-Specific Languages on Conference on Domain-Specific Languages (DSL), p. 19. USENIX Association, Berkeley (1997)
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)
Parr, T.: The Definitive ANTLR Reference: Building Domain-Specific Languages. Pragmatic Programmers (May 2007)
Bravenboer, M., Visser, E.: Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In: Schmidt, D.C. (ed.) Proceedings OOPSLA 2004, Vancouver, Canada, pp. 365–383. ACM Press, New York (October 2004)
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)
Goldberg, A., Robson, D.: Smalltalk 80: the Language and its Implementation. Addison-Wesley, Reading (1983)
Meyer, M., Gîrba, T., Lungu, M.: Mondrian: An agile visualization framework. In: ACM Symposium on Software Visualization (SoftVis 2006), pp. 135–144. ACM Press, New York (2006)
Renggli, L., Nierstrasz, O.: Transactional memory in a dynamic language. Journal of Computer Languages, Systems and Structures 35(1), 21–30 (2009)
Herlihy, M.P.: Wait-free synchronization. ACM Transactions on Programming Languages and Systems 13(1), 124–149 (1991)
Herlihy, M.P., Moss, J.E.B.: Transactional memory: Architectural support for lock-free data structures. In: Proceedings of the 20th Annual International Symposium on Computer Architecture, pp. 289–300 (1993)
Roberts, D., Brant, J., Johnson, R.E.: A refactoring tool for Smalltalk. Theory and Practice of Object Systems (TAPOS) 3(4), 253–263 (1997)
Futamura, Y.: Partial evaluation of computation process: An approach to a compiler-compiler. Higher Order Symbol. Comput. 12(4), 381–391 (1999)
Wirth, N.: What can we do about the unnecessary diversity of notation for syntactic definitions? ACM Commun. 20(11), 822–823 (1977)
Bracha, G.: Executable grammars in Newspeak. Electron. Notes Theor. Comput. Sci. 193, 3–18 (2007)
Tratt, L.: Domain specific language implementation via compile-time meta-programming. ACM TOPLAS 30(6), 1–40 (2008)
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 (2009) (to appear)
Bawden, A.: Quasiquotation in Lisp. In: Partial Evaluation and Semantic-Based Program Manipulation, pp. 4–12 (1999)
Taha, W.: A gentle introduction to multi-stage programming. In: Domain-Specific Program Generation, pp. 30–50 (2003)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Renggli, L., Gîrba, T., Nierstrasz, O. (2010). Embedding Languages without Breaking Tools. In: D’Hondt, T. (eds) ECOOP 2010 – Object-Oriented Programming. ECOOP 2010. Lecture Notes in Computer Science, vol 6183. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-14107-2_19
Download citation
DOI: https://doi.org/10.1007/978-3-642-14107-2_19
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-14106-5
Online ISBN: 978-3-642-14107-2
eBook Packages: Computer ScienceComputer Science (R0)