Featherweight Java: a minimal core calculus for Java and GJ

Several recent studies have introduced lightweight versions of Java: reduced languages in which complex features like threads and reflection are dropped to enable rigorous arguments about key properties such as type safety. We carry this process a step further, omitting almost all features of the full language (including interfaces and even assignment) to obtain a small calculus, Featherweight Java, for which rigorous proofs are not only possible but easy. Featherweight Java bears a similar relation to full Java as the lambda-calculus does to languages such as ML and Haskell. It offers a similar computational “feel,” providing classes, methods, fields, inheritance, and dynamic typecasts, with a semantics closely following Java's. A proof of type safety for Featherweight Java thus illustrates many of the interesting features of a safety proof for the full language, while remaining pleasingly compact. The syntax, type rules, and operational semantics of Featherweight Java fit on one page, making it easier to understand the consequences of extensions and variations. As an illustration of its utility in this regard, we extend Featherweight Java with generic classes in the style of GJ (Bracha, Odersky, Stoutamire, and Wadler) and sketch a proof of type safety. The extended system formalizes for the first time some of the key features of GJ.

[1]  Harold T. Hodes,et al.  The | lambda-Calculus. , 1988 .

[2]  Luca Cardelli,et al.  An Extension of System F with Subtyping , 1994, Inf. Comput..

[3]  Kim B. Bruce A paradigmatic object-oriented programming language: Design, static typing and semantics , 1994, Journal of Functional Programming.

[4]  Benjamin C. Pierce,et al.  Simple type-theoretic foundations for object-oriented programming , 1994, Journal of Functional Programming.

[5]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[6]  Mitchell Wand Type inference for objects with instance variables and inheritance , 1994 .

[7]  Martín Abadi,et al.  A Theory of Objects , 1996, Monographs in Computer Science.

[8]  Matthias Felleisen,et al.  A little Java, a few patterns , 1997 .

[9]  Martin Odersky,et al.  Pizza into Java: translating theory into practice , 1997, POPL '97.

[10]  Stephen N. Freund,et al.  Adding type parameterization to the Java language , 1997, OOPSLA '97.

[11]  Andrew C. Myers,et al.  Parameterized types for Java , 1997, POPL '97.

[12]  Tobias Nipkow,et al.  Javalight is type-safe—definitely , 1998, POPL '98.

[13]  Viviana Bono,et al.  An Imperative, First-Order Calculus with Object Extension , 1998, ECOOP.

[14]  Martin Odersky,et al.  Making the future safe for the past: adding genericity to the Java programming language , 1998, OOPSLA '98.

[15]  Matthias Felleisen,et al.  Classes and mixins , 1998, POPL '98.

[16]  John C. Mitchell,et al.  On the Relationship Between Classes, Objects, and Data Abstraction , 1998, Theory Pract. Object Syst..

[17]  Robert Cartwright,et al.  Compatible genericity with run-time types for the Java programming language , 1998, OOPSLA '98.

[18]  Vitaly Shmatikov,et al.  A Core Calculus of Classes and Mixins , 1999, ECOOP.

[19]  Don Syme,et al.  Proving Java Type Soundness , 1999, Formal Syntax and Semantics of Java.

[20]  Vitaly Shmatikov,et al.  A Core Calculus of Classes and Objects , 1999, MFPS.

[21]  Matthias Felleisen,et al.  A Programmer's Reduction Semantics for Classes and Mixins , 1999, Formal Syntax and Semantics of Java.

[22]  Sarfraz Khurshid,et al.  Is the Java Type System Sound? , 1999, Theory Pract. Object Syst..

[23]  Dominic Duggan Modular type-based reverse engineering of parameterized types in Java code , 1999, OOPSLA '99.

[24]  Mirko Viroli,et al.  Parametric polymorphism in Java: an approach to translation based on reflective features , 2000, OOPSLA '00.

[25]  Atsushi Igarashi,et al.  On Inner Classes , 2000, ECOOP.

[26]  Ulrik Pagh Schultz,et al.  Partial Evaluation for Class-Based Object-Oriented Languages , 2000, PADO.