skip to main content
10.1145/320384.320395acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article
Free Access

Featherweight Java: a minimal core calculus for Java and GJ

Published:01 October 1999Publication History

ABSTRACT

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.

References

  1. 1.Martin Abadi and Luca Cardelli. A Theory of Objects. Springer-Verlag, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2.Ole Agesen, Stephen N. Freund, and John C. Mitchell. Adding type parameterization to the Java language. 'In Object Oriented Programing: Systems, Languages, and Applications (OOPSLA), October 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.H. P. Barendregt. The Lambda Calculus. North Holland, revised edition, 1984.]]Google ScholarGoogle Scholar
  4. 4.Viviana Bono and Kathleen Fisher. An imperative first-order calculus with object extension. In Proceedings of the European Conference on Object- Oriented Programming (ECOOP), 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.Viviana Bono, Amit J. Patel, and Vitaly Shmatikov. A core calculus of classes and mixins. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), volume 1628 of Lecture Notes in Computer Science, pages 43-66. Springer-Verlag, June 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.Viviana Bono, Amit J. Patel, Vitaly Shmatikov, and John C. Mitchell. A core calculus of classes and objects. In Fifteenth Confertence on the Mathematical Foundations of Programming Semantics, April 1999.]]Google ScholarGoogle ScholarCross RefCross Ref
  7. 7.Gilad Bracha, Martin Odersky, David Stoutamire, and Philip Wadler. Making the future safe for the past- Adding genericity to the Java programming language. In Craig Chambers, editor, Object Oriented Programing: Systems, Languages, and Applications (0OPSLA}, ACM SIGPLAN Notices volume 33 number 10, pages 183-200, Vancouver, BC, October 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8.Kim B. Bruce. A paradigmatic object-oriented programming language' Design, static typing and semantics. Journal of Functional Programming, 4(2), April 1994. Preliminary version in POPL 1993, under the title "Safe type checking in a statically typed object-oriented programming language".]]Google ScholarGoogle ScholarCross RefCross Ref
  9. 9.Luca Cardelli, Simone Martini, John C. Mitchell, and Andre Scedrov. An extension of system F with subtyping. Information and Computation, 109(1- 2):4-56, 1994. Preliminary version in TACS '91 (Sendal, Japan, pp. 750-770).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.Robert Cartwright and Guy L. Steele Jr. Compatible genericity with run-time types for the Java programming language. In Craig Chambers, editor, Object Oriented Programing: Systems, Languages, and Applications (OOPSLA), SIGPLAN Notices 33(10), pages 201-215, Vancouver, BC, Octover 1998. ACM.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.S. Drossopoulou, S. Eisenbach, and S. Xhu.rshid. Is the Java Type System Sound? Theory and Practice of Object Systems~ 7(1):3-24, 1999. Preliminary version in ECOOP '97.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12.Matthias Felleisen and Daniel P. Friedman. A little Java, A few Patterns. The MIT Press, Cambridge, Massachusetts, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13.Kathleen Fisher and John C. Mitchell. On the relationship between classes, objects, and data abstraction. Theory and Practice of Object Systems, 4(1):3-25, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14.Matthew Flatt, Shriram Krishnamurthi, and Matthias FeUeisen. Classes and mixins, in A CM Symposium on Principles of Programming Languages (POPL), San Diego, January 1998. ACM.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 15.Matthew Flatt, Shriram Krishnamurthi, and Matthias Felleisen. A programmer's reduction semantics for classes and mixins. Technical Report TR97-293, Computer Science Department, Rice University, February 1998. Corrected version appeared in June, 1999.]]Google ScholarGoogle Scholar
  16. 16.Atsushi Igarashi and Benjamin C. Pierce. On inner classes, july 1999. Submitted for publication.]]Google ScholarGoogle Scholar
  17. 17.Andrew C. Myers, Joseph A. Bank, and Barbara Liskov. Parameterized types for Java. In A CM Symposium on Principles of Programming Languages (POPL), January 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 18.Tobias Nipkow and David yon Oheimb. Javatig^t is type-safe -- definitely. In A CM Symposium on Principles of Programmin9 Languages (POPL), pages 161-170, San Diego, January 1998. ACM.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 19.Martin Odersky and Philip Wadler. Pizza into Java: Translating theory into practice. In A CM Symposium on Principles of Programming Languages (POPL), 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 20.Benjamin C. Pierce and David N. Turner. Simple type-theoretic foundations for object-oriented programming. Journal of Functional Programming, 4(2):207-247, April 1994. Preliminary version in Principles of Programming Languages (POPL), 1993.]]Google ScholarGoogle ScholarCross RefCross Ref
  21. 21.Don Syme. Proving Java type soundness. Technical Report 427, Computer Laboratory, University of Cambridge, June 1997.]]Google ScholarGoogle Scholar
  22. 22.Mitchell Wand. Type inference for objects with instance variables and inheritance. Technical Report NU-CCS-89-2, College of Computer Science, Northeastern University, February 1989. Also in Carl A. Gunter and John (2. Mitchell, editors, Theoretical Aspects of Object-Oriented Programming: Types, Semantics, and Language Design (MIT Press, 1994).]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Featherweight Java: a minimal core calculus for Java and GJ

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in
            • Published in

              cover image ACM Conferences
              OOPSLA '99: Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
              October 1999
              462 pages
              ISBN:1581132387
              DOI:10.1145/320384

              Copyright © 1999 ACM

              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]

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 1 October 1999

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • Article

              Acceptance Rates

              OOPSLA '99 Paper Acceptance Rate30of152submissions,20%Overall Acceptance Rate268of1,244submissions,22%

              Upcoming Conference

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader