Implementing type systems for the IDE with Xsemantics

Abstract Xsemantics is a DSL for writing type systems, reduction rules and, in general, relation rules for languages implemented in Xtext (Xtext is an Eclipse framework for rapidly building languages together with all the typical IDE tooling). Xsemantics aims at reducing the gap between the formalization of a language (i.e., type system and operational semantics) and the actual implementation in Xtext, since it uses a syntax that resembles the rules in a formal setting. In this paper we present the main features of Xsemantics for implementing type systems and reduction rules through examples (Featherweight Java and lambda calculus). We show how such implementations are close to the actual formalizations, and how Xsemantics can be a helpful tool when proving the type safety of a language. We also describe the new features of Xsemantics that help achieving a modular and efficient implementation of type systems. In particular, we focus on specific implementation techniques for implementing type systems that are suited for the IDE (in our context, Eclipse), in order to keep the tooling responsive and guarantee a good user experience.

[1]  Eelco Visser,et al.  Declarative Name Binding and Scope Rules , 2012, SLE.

[3]  Lorenzo Bettini,et al.  A DSL for writing type systems for Xtext languages , 2011, PPPJ.

[4]  Yannis Smaragdakis,et al.  JTS: tools for implementing domain-specific languages , 1998, Proceedings. Fifth International Conference on Software Reuse (Cat. No.98TB100203).

[5]  Jean Bézivin,et al.  TCS:: a DSL for the specification of textual concrete syntaxes in model engineering , 2006, GPCE '06.

[6]  Frank Budinsky,et al.  EMF: Eclipse Modeling Framework 2.0 , 2009 .

[7]  Lorenzo Bettini Implementing Java-like languages in Xtext with Xsemantics , 2013, SAC '13.

[8]  Lawrence Charles Paulson,et al.  Isabelle: A Generic Theorem Prover , 1994 .

[9]  J. V. Tucker,et al.  Basic Simple Type Theory , 1997 .

[10]  Jurriaan Hage,et al.  Scripting the type inference process , 2003, ACM SIGPLAN Notices.

[11]  Bernard Lang,et al.  Metal: A Formalism to Specify Formalisms , 1983, Sci. Comput. Program..

[12]  S. Doaitse Swierstra,et al.  Ruler: Programming Type Rules , 2006, FLOPS.

[13]  Wilhelm Hasselbring,et al.  Xbase: implementing domain-specific languages for Java , 2012, GPCE '12.

[14]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[15]  Matthias Felleisen,et al.  Semantics Engineering with PLT Redex , 2009 .

[16]  Eelco Visser,et al.  MetaBorg in Action: Examples of Domain-Specific Language Embedding and Assimilation Using Stratego/XT , 2005, GTTSE.

[17]  Anneke Kleppe,et al.  The object constraint language: precise modeling with UML , 1998 .

[18]  Eelco Visser,et al.  A Language Designer's Workbench: A One-Stop-Shop for Implementation and Verification of Language Designs , 2014, Onward!.

[19]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[20]  Patrick Borras,et al.  Centaur: the system , 1988, Software Development Environments.

[21]  Thomas W. Reps,et al.  The synthesizer generator , 1984, SDE 1.

[22]  Philip Wadler,et al.  Featherweight Java: a minimal core calculus for Java and GJ , 1999, OOPSLA '99.

[23]  Jurriaan Hage,et al.  Strategies for Solving Constraints in Type and Effect Systems , 2009, Electron. Notes Theor. Comput. Sci..

[24]  V. Vergu,et al.  Delft University of Technology Dynsem : A DSL for dynamic semantics specification , 2017 .

[25]  Tom Ridge,et al.  Ott: effective tool support for the working semanticist , 2007, ICFP '07.

[26]  Paul Klint,et al.  Compiling language definitions: the ASF+SDF compiler , 2000, TOPL.

[27]  Heiko Behrens,et al.  Xtext: implement your language faster than the quick and dirty way , 2010, SPLASH/OOPSLA Companion.

[28]  Atsushi Igarashi,et al.  Union types for object-oriented programming , 2006, SAC.

[29]  Grigore Rosu,et al.  An overview of the K semantic framework , 2010, J. Log. Algebraic Methods Program..

[30]  Edoardo Vacchi,et al.  Neverlang: A framework for feature-oriented language development , 2015, Comput. Lang. Syst. Struct..

[31]  Elham Morcos-Chounet,et al.  PPML: A General Formalism to Specify PrettyPrinting , 1986, IFIP Congress.

[32]  Michael J. C. Gordon,et al.  From LCF to HOL: a short history , 2000, Proof, Language, and Interaction.

[33]  Tony Clark,et al.  Superlanguages: developing languages and applications with XMF. , 2008 .

[34]  S. Drossopoulou,et al.  Towards an Existential Types Model for Java Wildcards , 2007 .

[35]  Stephanie Weirich,et al.  Type Systems , 2014, Computing Handbook, 3rd ed..

[36]  Stanley M. Sutton,et al.  Accelerating the creation of customized, language-Specific IDEs in Eclipse , 2009, OOPSLA 2009.

[37]  Eelco Visser,et al.  The spoofax language workbench: rules for declarative specification of languages and IDEs , 2010, OOPSLA.

[38]  Eelco Visser,et al.  Stratego/XT 0.17. A language and toolset for program transformation , 2008, Sci. Comput. Program..

[39]  Guy L. Steele,et al.  The Java Language Specification, Java SE 8 Edition , 2013 .

[40]  Dietmar Stoll,et al.  Approaches and Tools for Implementing Type Systems in Xtext , 2012, SLE.

[41]  Markus Völter,et al.  Language and IDE Modularization and Composition with MPS , 2011, GTTSE.

[42]  Bernhard Rumpe,et al.  MontiCore: a framework for compositional development of domain specific languages , 2010, International Journal on Software Tools for Technology Transfer.

[43]  Mirko Seifert,et al.  Derivation and Refinement of Textual Syntax for Models , 2009, ECMDA-FA.

[44]  Hao Xu EriLex: An Embedded Domain Specific Language Generator , 2010, TOOLS.

[45]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[46]  John Levine,et al.  flex & bison , 2009 .

[47]  Eelco Visser,et al.  Evaluating and comparing language workbenches: Existing results and benchmarks for the future , 2015, Comput. Lang. Syst. Struct..

[48]  Edoardo Vacchi,et al.  Neverlang 2 - Componentised Language Development for the JVM , 2013, SC@STAF.

[49]  Dhanji R. Prasanna,et al.  Dependency Injection , 2009 .

[50]  Torbjörn Ekman,et al.  The JastAdd system - modular extensible compiler construction , 2007, Sci. Comput. Program..

[51]  Eelco Visser,et al.  The Spoofax language workbench , 2010, SPLASH/OOPSLA Companion.

[52]  Yves Bertot,et al.  Interactive Theorem Proving and Program Development: Coq'Art The Calculus of Inductive Constructions , 2010 .

[53]  Sam Tobin-Hochstadt,et al.  Run your research: on the effectiveness of lightweight mechanization , 2012, POPL '12.

[54]  Eelco Visser,et al.  A Theory of Name Resolution , 2015, ESOP.

[55]  Terence Parr The Definitive ANTLR Reference: Building Domain-Specific Languages , 2007 .

[56]  M. Pfeiffer,et al.  A Comparison of Tool Support for Textual Domain-Specific Languages , 2008 .

[57]  Frank Budinsky,et al.  Eclipse Modeling Framework , 2003 .

[58]  Gilad Bracha Pluggable Type Systems , 2004 .