skip to main content
10.1145/2093157.2093163acmotherconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

A DSL for writing type systems for Xtext languages

Published: 24 August 2011 Publication History

Abstract

Xtext is a framework for the development of languages, which also generates all the typical and recurrent artifacts for a fully-fledged IDE on top of Eclipse. The validation (e.g., checking the correctness of programs from the point of view of types) of languages developed in Xtext has to be implemented by the programmer writing Java code. In this paper we present XTypeS (Xtext TypeSystem), a DSL for writing the type system for an Xtext language. A type system definition in XTypeS is a set of rules which act on the elements of the AST of a program, which in Xtext is represented by an EMF model. Then, XTypeS will generate the corresponding Java code that can be used to implement the validation part for a language developed in Xtext. We describe the features of XTypeS by writing the type system of two languages implemented in Xtext: Featherweight Java and λ-calculus.

References

[1]
DLTK. http://www.eclipse.org/dltk.
[2]
Google Guice. http://code.google.com/p/google-guice.
[3]
Xtext. http://www.eclipse.org/Xtext.
[4]
A. V. Aho, M. S. Lam, R. Sethi, and J. D. Ullman, editors. Compilers: principles, techniques, and tools. Addison Wesley, 2nd edition, 2007.
[5]
D. Batory, B. Lofaso, and Y. Smaragdakis. JTS: Tools for Implementing Domain-Specific Languages. In ICSR, pages 143--153. IEEE, 1998.
[6]
S. Berghofer and T. Nipkow. Executing Higher Order Logic. In TYPES, volume 2277 of LNCS, pages 24--40. Springer, 2000.
[7]
Y. Bertot and P. P. Castéran. Interactive theorem proving and program development: Coq'Art: the calculus of inductive constructions. Texts in theoretical computer science. Springer, 2004.
[8]
L. Bettini. An Eclipse-based IDE for Featherweight Java implemented in Xtext. In ECLIPSE-IT, pages 14--28, 2010.
[9]
L. Bettini, F. Damiani, I. Schaefer, and F. Strocco. A Prototypical Javalike Language with Records and Traits. In PPPJ, pages 2096--2102. ACM, 2010.
[10]
P. Borras, D. Clement, T. Despeyroux, J. Incerpi, G. Kahn, B. Lang, and V. Pascual. CENTAUR: the system. In Software Engineering Symposium on Practical Software Development Environments, volume 24 of SIGPLAN, pages 14--24. ACM, 1988.
[11]
G. Bracha. Pluggable Type Systems. In Workshop on Revival of Dynamic Languages, 2004.
[12]
M. G. J. V. D. Brand, J. Heering, P. Klint, and P. A. Olivier. Compiling language definitions: the ASF+SDF compiler. ACM TOPLAS, 24(4):334--368, 2002.
[13]
M. Bravenboer, R. de Groot, and E. Visser. MetaBorg in Action: Examples of Domain-Specific Language Embedding and Assimilation Using Stratego/XT. In GTTSE, volume 4143 of LNCS, pages 297--311. Springer, 2006.
[14]
M. Bravenboer, K. T. Kalleberg, R. Vermaas, and E. Visser. Stratego/XT 0.17. A language and toolset for program transformation. Science of Computer Programming, 72(1--2):52--70, 2008.
[15]
W. Cazzola and D. Poletti. DSL Evolution through Composition. In RAM-SE. ACM, 2010.
[16]
P. Charles, R. Fuhrer, S. Sutton Jr., E. Duesterwald, and J. Vinju. Accelerating the creation of customized, language-Specific IDEs in Eclipse. In OOPSLA, pages 191--206. ACM, 2009.
[17]
T. Clark, P. Sammut, and J. Willans. Superlanguages, Developing Languages and Applications with XMF. Ceteva, 1st edition, 2008.
[18]
D. Delahaye, C. Dubois, and J.-F. Étienne. Extracting Purely Functional Contents from Logical Inductive Types. In TPHOLs, volume 4732 of LNCS, pages 70--85. Springer, 2007.
[19]
T. Despeyroux. Typol: a formalism to implement natural semantics. Technical Report 94, INRIA, Mar. 1988.
[20]
A. Dijkstra and S. D. Swierstra. Ruler: Programming Type Rules. In FLOPS, volume 3945 of LNCS, pages 30--46. Springer, 2006.
[21]
T. Ekman and G. Hedin. The JastAdd system -- modular extensible compiler construction. Science of Computer Programming, 69(1--3):14--26, 2007.
[22]
M. Felleisen, R. B. Findler, and M. Flatt. Semantics Engineering with PLT Redex. The MIT Press, Cambridge, Mass., 2009.
[23]
M. Fowler. A Language Workbench in Action - MPS. http://martinfowler.com/articles/mpsAgree.html, 2008.
[24]
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.
[25]
M. Gordon. From LCF to HOL: a short history. In Proof, Language, and Interaction: Essays in Honour of Robin Milner, pages 169--186. The MIT Press, 2000.
[26]
F. Heidenreich, J. Johannes, S. Karol, M. Seifert, and C. Wende. Derivation and Refinement of Textual Syntax for Models. In ECMDAFA, volume 5562 of LNCS, pages 114--129. Springer, 2009.
[27]
A. Igarashi, B. Pierce, and P. Wadler. Featherweight Java: a minimal core calculus for Java and GJ. ACM TOPLAS, 23(3):396--450, 2001.
[28]
F. Jouault, J. Bézivin, and I. Kurtev. TCS: a DSL for the specification of textual concrete syntaxes in model engineering. In GPCE, pages 249--254. ACM, 2006.
[29]
G. Kahn, B. Lang, B. Melese, and E. Morcos. Metal: A formalism to specify formalisms. Science Of Computer Programming, 3(2):151--188, 1983.
[30]
L. C. L. Kats and E. Visser. The Spoofax language workbench. Rules for declarative specification of languages and IDEs. In OOPSLA, pages 444--463. ACM, 2010.
[31]
H. Krahn, B. Rumpe, and S. Völkel. Monticore: a framework for compositional development of domain specific languages. STTT, 12(5):353--372, 2010.
[32]
E. Morcos-Chounet and A. Conchon. PPML: A general formalism to specify prettyprinting. In IFIP Congress, pages 583--590, 1986.
[33]
Object Management Group. Object Constraint Language, Version 2.2. Omg document number: formal/2010-02-01 edition, 2010. http://www.omg.org/spec/OCL/2.2.
[34]
T. Parr. The Definitive ANTLR Reference: Building Domain-Specific Languages. Pragmatic Programmers, May 2007.
[35]
L. C. Paulson. Isabelle: A Generic Theorem Prover, volume 828 of LNCS. Springer, 1994.
[36]
M. Pfeiffer and J. Pichler. A comparison of tool support for textual domain-specific languages. In Proc. DSM, pages 1--7, 2008.
[37]
L. Renggli, M. Denker, and O. Nierstrasz. Language Boxes: Bending the Host Language with Modular Language Changes. In SLE, volume 5969 of LNCS, pages 274--293. Springer, 2009.
[38]
T. Reps and T. Teitelbaum. The Synthesizer Generator. In Software Engineering Symposium on Practical Software Development Environments, pages 42--48. ACM, 1984.
[39]
J. A. Robinson. Computational logic: The unification computation. Machine Intelligence, 6, 1971.
[40]
I. Schaefer, L. Bettini, V. Bono, F. Damiani, and N. Tanzarella. Delta-oriented Programming of Software Product Lines. In SPLC, volume 6287 of LNCS, pages 77--91. Springer, 2010.
[41]
P. Sewell, F. Z. Nardelli, S. Owens, G. Peskine, T. Ridge, S. Sarkar, and R. Strnisa. Ott: Effective tool support for the working semanticist. J. Funct. Program, 20(1):71--122, 2010.
[42]
D. Steinberg, F. Budinsky, M. Paternostro, and E. Merks. EMF: Eclipse Modeling Framework. Addison-Wesley, 2nd edition, 2008.
[43]
M. Völter. Xtext/TS - a typesystem framework for Xtext, 2011. http://xtext-typesystem.eclipselabs.org.codespot.com-/files/XTextTypesystem-2.0.pdf.
[44]
J. Warmer and A. Kleppe. The Object Constraint Language: Precise Modeling with UML. Addison Wesley, 1999.
[45]
H. Xu. EriLex: An Embedded Domain Specific Language Generator. In TOOLS, volume 6141 of LNCS, pages 192--212. Springer, 2010.

Cited By

View all
  • (2023)Adaptive Structural Operational SemanticsProceedings of the 16th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3623476.3623517(29-42)Online publication date: 23-Oct-2023
  • (2020)Extrinsically typed operational semantics for functional languagesProceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3426425.3426936(108-125)Online publication date: 16-Nov-2020
  • (2016)A service-oriented domain specific language programming approach for batch processes2016 IEEE 21st International Conference on Emerging Technologies and Factory Automation (ETFA)10.1109/ETFA.2016.7733729(1-9)Online publication date: Sep-2016
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
PPPJ '11: Proceedings of the 9th International Conference on Principles and Practice of Programming in Java
August 2011
186 pages
ISBN:9781450309356
DOI:10.1145/2093157
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

  • DTU: Technical University of Denmark
  • ORACLE: ORACLE

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 24 August 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. DSL
  2. Eclipse
  3. implementation
  4. type system
  5. types

Qualifiers

  • Research-article

Conference

PPPJ '11
Sponsor:
  • DTU
  • ORACLE
PPPJ '11: Principles and Practice of Programming in Java
August 24 - 26, 2011
Kongens Lyngby, Denmark

Acceptance Rates

Overall Acceptance Rate 29 of 58 submissions, 50%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)15
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2023)Adaptive Structural Operational SemanticsProceedings of the 16th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3623476.3623517(29-42)Online publication date: 23-Oct-2023
  • (2020)Extrinsically typed operational semantics for functional languagesProceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3426425.3426936(108-125)Online publication date: 16-Nov-2020
  • (2016)A service-oriented domain specific language programming approach for batch processes2016 IEEE 21st International Conference on Emerging Technologies and Factory Automation (ETFA)10.1109/ETFA.2016.7733729(1-9)Online publication date: Sep-2016
  • (2015)Establishing Operational Models for Dynamic Compilation in a Simulation PlatformNature of Computation and Communication10.1007/978-3-319-15392-6_12(117-131)Online publication date: 24-Jan-2015
  • (2014)A domain-specific language for building self-optimizing AST interpretersACM SIGPLAN Notices10.1145/2775053.265877650:3(123-132)Online publication date: 15-Sep-2014
  • (2014)A domain-specific language for building self-optimizing AST interpretersProceedings of the 2014 International Conference on Generative Programming: Concepts and Experiences10.1145/2658761.2658776(123-132)Online publication date: 15-Sep-2014
  • (2013)Implementing Java-like languages in Xtext with XsemanticsProceedings of the 28th Annual ACM Symposium on Applied Computing10.1145/2480362.2480654(1559-1564)Online publication date: 18-Mar-2013
  • (2013)Approaches and Tools for Implementing Type Systems in XtextSoftware Language Engineering10.1007/978-3-642-36089-3_22(392-412)Online publication date: 2013

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media