Abstract
Xtext is an open-source framework for implementing external, textual domain-specific languages (DSLs). So far, most DSLs implemented with Xtext and similar tools focus on structural aspects such as service specifications and entities. Because behavioral aspects are significantly more complicated to implement, they are often delegated to general-purpose programming languages. This approach introduces complex integration patterns and the DSL's high level of abstraction is compromised.
We present Xbase as part of Xtext, an expression language that can be reused via language inheritance in any DSL implementation based on Xtext. Xbase expressions provide both control structures and program expressions in a uniform way. Xbase is statically typed and tightly integrated with the Java type system. Languages extending Xbase inherit the syntax of a Java-like expression language as well as language infrastructure components, including a parser, an unparser, a linker, a compiler and an interpreter. Furthermore, the framework provides integration into the Eclipse IDE including debug and refactoring support.
The application of Xbase is presented by means of a domain model language which serves as a tutorial example and by the implementation of the programming language Xtend. Xtend is a functional and object-oriented general purpose language for the Java Virtual Machine (JVM). It is built on top of Xbase which is the reusable expression language that is the foundation of Xtend.
- Hassan Chafi, Zach DeVito, Adriaan Moors, Tiark Rompf, Arvind Sujeeth, Pat Hanrahan, Martin Odersky, and Kunle Olukotun. Language Virtualization for Heterogeneous Parallel Computing. Technical report, EPFL, 2010.Google Scholar
- E. F. Codd. A relational model of data for large shared data banks. Commun. ACM, 13: 377--387, June 1970. Google Scholar
Digital Library
- Sven Efftinge, Moritz Eysholdt, Jan Köhnlein, Sebastian Zarnekow, and Contributors. Xtext 2.2 Documentation, December 2011.Google Scholar
- Sven Efftinge, Sören Frey, Wilhelm Hasselbring, and Jan Köhnlein. Einsatz domänenspezifischer Sprachen zur Migration von Datenbankanwendungen. In Datenbanksysteme für Business, Technologie und Web (BTW 2011), volume P-180 of Lecture Notes in Informatics, pages 554--573, Kaiserslautern, March 2011.Google Scholar
- Eugene Burmako, Martin Odersky, Christopher Vogt, Stefan Zeiger, Adriaan Moors. Self Cleaning Macros (SIP 16), March 2012.Google Scholar
- M. Eysholdt and J. Rupprecht. Migrating a large modeling environment from XML/UML to Xtext/GMF. In Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion, pages 97--104. ACM, 2010. Google Scholar
Digital Library
- Martin Fowler. Domain Specific Languages. Addison-Wesley Professional, 1st edition, 2010. Google Scholar
Digital Library
- Debasish Ghosh. DSLs in Action. Manning Publications, pap/psc edition, December 2010. Google Scholar
Digital Library
- Wolfgang Goerigk, Reinhard von Hanxleden, Wilhelm Hasselbring, Gregor Hennings, Reiner Jung, Holger Neustock, Heiko Schaefer, Christian Schneider, Elferik Schultz, Thomas Stahl, Steffen Weik, and Stefan Zeug. Entwurf einer domänenspezifischen Sprache für elektronische Stellwerke. In Software Engineering 2012, volume P-198 of Lecture Notes in Informatics (LNI), pages 119--130. GI, March 2012.Google Scholar
- Peter Henderson. Functional geometry. In Symposium on LISP and Functional Programming, pages 179--187, 1982. Google Scholar
Digital Library
- P. Hudak. Describing and interpreting music in Haskell. In J. Gibbons and O. de Moor, editors, The Fun of Programming, pages 61--78. Palgrave Macmillan, 2003.Google Scholar
Cross Ref
- J. Hughes. Why functional programming matters. In D. A. Turner, editor, Research Topics in Functional Programming, pages 17--42. Addison Wesley, 1990. Google Scholar
Digital Library
- Java Community Process. Lambda Specification (Early Draft Review #1), November 2011.Google Scholar
- Lennart C. L. Kats and Eelco Visser. The Spoofax language workbench. Rules for declarative specification of languages and IDEs. In Martin Rinard, editor, Proceedings of the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 444--463, October 2010. Google Scholar
Digital Library
- Olaf Kindel and Mario Friedrich. Softwareentwicklung mit AUTOSAR. dpunkt.verlag, 2009.Google Scholar
- Dierk Koenig, Andrew Glover, Paul King, Guillaume Laforge, and Jon Skeet. Groovy in Action. Manning Publications Co., 2007. Google Scholar
Digital Library
- Holger Krahn, Bernhard Rumpe, and Steven Völkel. MontiCore: a Framework for Compositional Development of Domain Specific Languages. International Journal on Software Tools for Technology Transfer (STTT), 12: 353--372, September 2010. Google Scholar
Digital Library
- S. L. Peyton Jones and J.-M. Eber. How to write a financial contract. In J. Gibbons and O. de Moor, editors, The Fun of Programming, pages 105--129. Palgrave Macmillan, 2003.Google Scholar
Cross Ref
- Dhanji R. Prasanna. Dependency Injection. Manning Publications Co., 2009. Google Scholar
Digital Library
- Markus Voelter and Konstantin Solomatov. Language modularization and composition with projectional language workbenches illustrated with MPS. In Mark van den Brand, Brian Malloy, and Steffen Staab, editors, Software Language Engineering, Third International Conference, SLE 2010, Lecture Notes in Computer Science. Springer, 2010.Google Scholar
- P. Wadler. A prettier printer. In J. Gibbons and O. de Moor, editors, The Fun of Programming, pages 223--243. Palgrave Macmillan, 2003.Google Scholar
Cross Ref
- Niklaus Wirth. What can we do about the unnecessary diversity of notation for syntactic definitions? Commun. ACM, 20: 822--823, November 1977. Google Scholar
Digital Library
Index Terms
Xbase: implementing domain-specific languages for Java
Recommendations
Xbase: implementing domain-specific languages for Java
GPCE '12: Proceedings of the 11th International Conference on Generative Programming and Component EngineeringXtext is an open-source framework for implementing external, textual domain-specific languages (DSLs). So far, most DSLs implemented with Xtext and similar tools focus on structural aspects such as service specifications and entities. Because behavioral ...
Graceful Dialects
Proceedings of the 28th European Conference on ECOOP 2014 --- Object-Oriented Programming - Volume 8586Programming languages are enormously diverse, both in their essential concepts and in their accidental aspects. This creates a problem when teaching programming. To let students experience the diversity of essential concepts, the students must also be ...
Mixing source and bytecode: a case for compilation by normalization
Language extensions increase programmer productivity by providing concise, often domain-specific syntax, and support for static verification of correctness, security, and style constraints. Language extensions can often be realized through translation ...






Comments