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.
- 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 Scholar
Digital Library
- E. Burmako. Scala macros: Let our powers combine! In Scala Workshop, 2013. to appear.Google Scholar
- M. de Jonge. A pretty-printer for every occasion. In Proceedings of Symposium on Constructing Software Engineering Tools (CoSET), pages 68--77, 2000.Google Scholar
- D. de Rauglaudre. Camlp4 reference manual. http://caml.inria.fr/pub/docs/manual-camlp4/index.html, accessed Mar. 26 2013, 2003.Google Scholar
- R. K. Dybvig, R. Hieb, and C. Bruggeman. Syntactic abstraction in scheme. Lisp and Symbolic Computation, 5(4):295--326, 1992. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- S. Erdweg. Extensible Languages for Flexible and Principled Domain Abstraction. PhD thesis, Philipps-Universiät Marburg, 2013.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- M. Flatt. Creating languages in Racket. Communication of the ACM, 55(1):48--56, 2012. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- M. Fowler. Language workbenches: The killer-app for domain specific languages' Available at http://martinfowler.com/articles/languageWorkbench.html, 2005.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- OSGi Alliance. Osgi core release 5, 2012.Google Scholar
- F. Rieger. A language-independent framework for syntactic extensibility. Bachelor's Thesis, University of Marburg, June 2012.Google Scholar
- T. Sheard and S. Peyton Jones. Template meta-programming for Haskell. In Proceedings of Haskell Workshop, pages 1--16. ACM, 2002. Google Scholar
Digital Library
- K. Skalski, M. Moskal, and P. Olszta. Meta-programming in nemerle. http://nemerle.org/metaprogramming.pdf, accessed Oct. 01 2012., 2004.Google Scholar
- R. Stallman and Z. Weinberg. The C Preprocessor. Available at http://gcc.gnu.org/onlinedocs/cpp/, accessed Nov. 08, 2012, 1987.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- E. Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, 1997.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
A framework for extensible languages
Recommendations
A framework for extensible languages
GPCE '13: Proceedings of the 12th international conference on Generative programming: concepts & experiencesExtensible 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 ...
Layout-sensitive language extensibility with SugarHaskell
Haskell '12: Proceedings of the 2012 Haskell SymposiumProgrammers need convenient syntax to write elegant and concise programs. Consequently, the Haskell standard provides syntactic sugar for some scenarios (e.g., do notation for monadic code), authors of Haskell compilers provide syntactic sugar for more ...
Layout-sensitive language extensibility with SugarHaskell
Haskell '12Programmers need convenient syntax to write elegant and concise programs. Consequently, the Haskell standard provides syntactic sugar for some scenarios (e.g., do notation for monadic code), authors of Haskell compilers provide syntactic sugar for more ...







Comments