skip to main content
research-article

A framework for extensible languages

Published:27 October 2013Publication History
Skip Abstract Section

Abstract

Extensible programming languages such as SugarJ or Racket enable programmers to introduce customary language features as extensions of the base language. Traditionally, systems that support language extensions are either (i) agnostic to the base language or (ii) only support a single base language. In this paper, we present a framework for language extensibility that turns a non-extensible language into an extensible language featuring library-based extensible syntax, extensible static analyses, and extensible editor support. To make a language extensible, our framework only requires knowledge of the base language's grammar, the syntax for import statements (which activate extensions), and how to compile base-language programs. We have evaluated the generality of our framework by instantiating it for Java, Haskell, Prolog, JavaScript, and System Fω, and by studying existing module-system features and their support in our framework.

References

  1. J. Bachrach and K. Playford. The Java syntactic extender (JSE). In Proceedings of Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 31--42. ACM, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. E. Burmako. Scala macros: Let our powers combine! In Scala Workshop, 2013. to appear.Google ScholarGoogle Scholar
  3. M. de Jonge. A pretty-printer for every occasion. In Proceedings of Symposium on Constructing Software Engineering Tools (CoSET), pages 68--77, 2000.Google ScholarGoogle Scholar
  4. D. de Rauglaudre. Camlp4 reference manual. http://caml.inria.fr/pub/docs/manual-camlp4/index.html, accessed Mar. 26 2013, 2003.Google ScholarGoogle Scholar
  5. R. K. Dybvig, R. Hieb, and C. Bruggeman. Syntactic abstraction in scheme. Lisp and Symbolic Computation, 5(4):295--326, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. Efftinge, M. Eysholdt, J. Köhnlein, S. Zarnekow, R. von Massow, W. Hasselbring, and M. Hanus. Xbase: implementing domain-specific languages for java. In Proceedings of Conference on Generative Programming and Component Engineering (GPCE), pages 112--121. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Erdweg. Extensible Languages for Flexible and Principled Domain Abstraction. PhD thesis, Philipps-Universiät Marburg, 2013.Google ScholarGoogle Scholar
  8. S. Erdweg, L. C. L. Kats, T. Rendel, C. Kästner, K. Ostermann, and E. Visser. Growing a language environment with editor libraries. In Proceedings of Conference on Generative Programming and Component Engineering (GPCE), pages 167--176. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Erdweg and K. Ostermann. Featherweight TeX and parser correctness. In Proceedings of Conference on Software Language Engineering (SLE), volume 6563 of LNCS, pages 397--416. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Erdweg, T. Rendel, C. Kästner, and K. Ostermann. SugarJ: Library-based syntactic language extensibility. In Proceedings of Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 391--406. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Erdweg, T. Rendel, C. Kästner, and K. Ostermann. Layout-sensitive generalized parsing. In Proceedings of Conference on Software Language Engineering (SLE), volume 7745 of LNCS, pages 244--263. Springer, 2012.Google ScholarGoogle Scholar
  12. S. Erdweg, F. Rieger, T. Rendel, and K. Ostermann. Layout-sensitive language extensibility with SugarHaskell. In Proceedings of Haskell Symposium, pages 149--160. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Erdweg, T. van der Storm, M. Völter, M. Boersma, R. Bosman, W. R. Cook, A. Gerritsen, A. Hulshout, S. Kelly, A. Loh, G. Konat, P. J. Molina, M. Palatnik, R. Pohjonen, E. Schindler, K. Schindler, R. Solmi, V. Vergu, E. Visser, K. van der Vlist, G. Wachsmuth, and J. van der Woning. The state of the art in language workbenches. In SLE, 2013. to appear.Google ScholarGoogle Scholar
  14. M. Flatt. Creating languages in Racket. Communication of the ACM, 55(1):48--56, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Flatt, R. Culpepper, D. Darais, and R. B. Findler. Macros that work together - Compile-time bindings, partial expansion, and definition contexts. Functional Programming, 22(2):181--216, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Fowler. Language workbenches: The killer-app for domain specific languages' Available at http://martinfowler.com/articles/languageWorkbench.html, 2005.Google ScholarGoogle Scholar
  17. O. Gruber, B. J. Hargrave, J. McAffer, P. Rapicault, and T. Watson. The Eclipse 3.0 platform: Adopting OSGi technology. IBM Systems Journal, 44(2):289--300, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C. Hofer, K. Ostermann, T. Rendel, and A. Moors. Polymorphic embedding of DSLs. In Proceedings of Conference on Generative Programming and Component Engineering (GPCE), pages 137--148. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. L. C. L. Kats and E. Visser. The Spoofax language workbench: Rules for declarative specification of languages and IDEs. In Proceedings of Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 444--463. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. F. Lorenzen and S. Erdweg. Modular and automated type-soundness verification for language extensions. In Proceedings of International Conference on Functional Programming (ICFP), 2013. to appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. OSGi Alliance. Osgi core release 5, 2012.Google ScholarGoogle Scholar
  22. F. Rieger. A language-independent framework for syntactic extensibility. Bachelor's Thesis, University of Marburg, June 2012.Google ScholarGoogle Scholar
  23. T. Sheard and S. Peyton Jones. Template meta-programming for Haskell. In Proceedings of Haskell Workshop, pages 1--16. ACM, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. K. Skalski, M. Moskal, and P. Olszta. Meta-programming in nemerle. http://nemerle.org/metaprogramming.pdf, accessed Oct. 01 2012., 2004.Google ScholarGoogle Scholar
  25. R. Stallman and Z. Weinberg. The C Preprocessor. Available at http://gcc.gnu.org/onlinedocs/cpp/, accessed Nov. 08, 2012, 1987.Google ScholarGoogle Scholar
  26. M. Tatsubori, S. Chiba, M.-O. Killijian, and K. Itano. OpenJava: A class-based macro system for Java. In Proceedings of Workshop on Reflection and Software Engineering, volume 1826 of LNCS, pages 117--133. Springer, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S. Tobin-Hochstadt, V. St-Amour, R. Culpepper, M. Flatt, and M. Felleisen. Languages as libraries. In Proceedings of Conference on Programming Language Design and Implementation (PLDI), pages 132--141. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. van den Brand and E. Visser. Generation of formatters for context-free languages. Transactions on Software Engineering Methodology (TOSEM), 5(1):1--41, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. E. Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, 1997.Google ScholarGoogle Scholar
  30. E. Visser, Z.-E.-A. Benaissa, and A. P. Tolmach. Building program optimizers with rewriting strategies. In Proceedings of International Conference on Functional Programming (ICFP), pages 13--26. ACM, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. D. Weise and R. F. Crew. Programmable syntax macros. In Proceedings of Conference on Programming Language Design and Implementation (PLDI), pages 156--165. ACM, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A framework for extensible languages

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!