Software Evolution to Domain-Specific Languages

  • Stefan Fehrenbach
  • Sebastian Erdweg
  • Klaus Ostermann
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8225)


Domain-specific languages (DSLs) can improve software maintainability due to less verbose syntax, avoidance of boilerplate code, more accurate static analysis, and domain-specific tool support. However, most existing applications cannot capitalise on these benefits because they were not designed to use DSLs, and rewriting large existing applications from scratch is infeasible. We propose a process for evolving existing software to use embedded DSLs based on modular definitions and applications of syntactic sugar as provided by the extensible programming language SugarJ. Our process is incremental along two dimensions: A developer can add support for another DSL as library, and a developer can refactor more code to use the syntax, static analysis, and tooling of a DSL. Importantly, the application remains executable at all times and no complete rewrite is necessary. We evaluate our process by incrementally evolving the Java Pet Store and a deliberately small part of the Eclipse IDE to use language support for field-accessors, JPQL, XML, and XML Schema. To help maintainers to locate Java code that would benefit from using DSLs, we developed a tool that analyses the definition of a DSL to derive patterns of Java code that could be represented with a high-level abstraction of the DSL instead.


Language Extension Abstract Syntax Tree Language Support Syntactic Sugar String Concatenation 
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.
    Bachrach, J., Playford, K.: The Java syntactic extender (JSE). In: OOPSLA, pp. 31–42. ACM (2001)Google Scholar
  2. 2.
    Batory, D., Johnson, C., MacDonald, B., von Heeder, D.: Achieving extensibility through product-lines and domain-specific languages: A case study. TOSEM 11(2), 191–214 (2002)CrossRefGoogle Scholar
  3. 3.
    Bennett, K.H., Rajlich, V.T.: Software maintenance and evolution: A roadmap. In: FOSE, pp. 73–87. ACM (2000)Google Scholar
  4. 4.
    Bianchi, A., Caivano, D., Marengo, V., Visaggio, G.: Iterative reengineering of legacy systems. Transactions on Software Engineering (TSE) 29(3), 225–241 (2003)CrossRefGoogle Scholar
  5. 5.
    Brabrand, C., Schwartzbach, M.I.: Growing languages with metamorphic syntax macros. In: PEPM, pp. 31–40. ACM (2002)Google Scholar
  6. 6.
    Dmitriev, S.: Language oriented programming: The next programming paradigm (2004)Google Scholar
  7. 7.
    Ekman, T., Hedin, G.: The JastAdd extensible Java compiler. In: OOPSLA, pp. 1–18. ACM (2007)Google Scholar
  8. 8.
    Erdweg, S.: Extensible Languages for Flexible and Principled Domain Abstraction. PhD thesis, Philipps-Universiät Marburg (2013)Google Scholar
  9. 9.
    Erdweg, S., Giarrusso, P.G., Rendel, T.: Language composition untangled. In: LDTA, pp. 7:1–7:8. ACM (2012)Google Scholar
  10. 10.
    Erdweg, S., Kats, L.C.L., Rendel, T., Kästner, C., Ostermann, K., Visser, E.: Growing a language environment with editor libraries. In: GPCE, pp. 167–176. ACM (2011)Google Scholar
  11. 11.
    Erdweg, S., Rendel, T., Kästner, C., Ostermann, K.: SugarJ: Library-based syntactic language extensibility. In: OOPSLA, pp. 391–406. ACM (2011)Google Scholar
  12. 12.
    Erdweg, S., et al.: The state of the art in language workbenches. In: Erwig, M., Paige, R.F., Van Wyk, E. (eds.) SLE 2013. LNCS, vol. 8225, pp. 197–217. Springer, Heidelberg (2013)Google Scholar
  13. 13.
    Flyvbjerg, B.: Five misunderstandings about case-study research. Qualitative Inquiry, 219–245 (2006)Google Scholar
  14. 14.
    Fowler, M.: Language workbenches: The killer-app for domain specific languages (2005),
  15. 15.
    Germán, D.M., Davies, J.: Apples vs. oranges?: An exploration of the challenges of comparing the source code of two software systems. In: MSR, pp. 246–249. IEEE (2011)Google Scholar
  16. 16.
    Gil, J., Lenz, K.: Simple and safe SQL queries with C++ templates. Science of Computer Programming 75(7), 573–595 (2010)CrossRefzbMATHGoogle Scholar
  17. 17.
    Hudak, P.: Modular domain specific languages and tools. In: Proceedings of International Conference on Software Reuse (ICSR), pp. 134–142. IEEE (1998)Google Scholar
  18. 18.
    Kats, L.C.L., Visser, E.: The Spoofax language workbench: Rules for declarative specification of languages and IDEs. In: OOPSLA, pp. 444–463. ACM (2010)Google Scholar
  19. 19.
    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)CrossRefGoogle Scholar
  20. 20.
    Sneed, H.M.: Planning the reengineering of legacy systems. IEEE Software 12(1), 24–34 (1995)CrossRefGoogle Scholar
  21. 21.
    Steele Jr., G.L.: Growing a language. Higher-Order and Symbolic Computation 12(3), 221–236 (1999)CrossRefGoogle Scholar
  22. 22.
    Sun Microsystems. Java Pet Store (2002), (accessed November 14, 2012)
  23. 23.
    van Deursen, A., Klint, P.: Little languages: Little maintenance? Software Maintenance 10(2), 75–92 (1998)CrossRefGoogle Scholar
  24. 24.
    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
  25. 25.
    Visser, E.: Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam (1997)Google Scholar
  26. 26.
    Visser, E.: Meta-programming with concrete object syntax. In: Batory, D., Blum, A., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 299–315. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  27. 27.
    Visser, E., Benaissa, Z.-E.-A.: A core language for rewriting. Electronic Notes in Theoretical Computer Science 15, 422–441 (1998)CrossRefGoogle Scholar
  28. 28.
    Visser, E., Benaissa, Z.-E.-A., Tolmach, A.P.: Building program optimizers with rewriting strategies. In: ICFP, pp. 13–26. ACM (1998)Google Scholar
  29. 29.
    Ward, M.P.: Language-oriented programming. Software – Concepts and Tools 15, 147–161 (1995)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2013

Authors and Affiliations

  • Stefan Fehrenbach
    • 1
  • Sebastian Erdweg
    • 2
  • Klaus Ostermann
    • 1
  1. 1.University of MarburgGermany
  2. 2.TU DarmstadtGermany

Personalised recommendations