Advertisement

A statically safe alternative to virtual types

  • Kim B. Bruce
  • Martin Odersky
  • Philip Wadler
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1445)

Abstract

Parametric types and virtual types have recently been proposed as extensions to Java to support genericity. In this paper we investigate the strengths and weaknesses of each. We suggest a variant of virtual types which has similar expressiveness, but supports safe static type checking. This results in a language in which both parametric types and virtual types are well-integrated, and which is statically type-safe.

Keywords

Language design virtual types parametric polymorphism static type checking 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [AFM97]
    Ole Agesen, Stephen Freund, and John C. Mitchell. Adding parameterized types to Java. In Symposium on Object-Oriented Programming: Systems, Languages, and Applications, ACM, 1997.Google Scholar
  2. [BCCHLP95]
    Kim B. Bruce, Luca Cardelli, Giuseppe Castagna, The Hopkins Objects Group, Gary T. Leavens, and Benjamin Pierce. On binary methods. Theory and Practice of Object-Oriented Systems, 1(3): 221–242, 1995.Google Scholar
  3. [BFP97]
    Kim B. Bruce, Adrian Fiech, and Leaf Petersen. Subtyping is not a good “match” for object-oriented languages. In ECOOP '97, pages 104–127. LNCS 1241, Springer-Verlag, 1997.Google Scholar
  4. [Bru94]
    Kim B. Bruce. A paradigmatic object-oriented programming language: design, static typing and semantics. Journal of Functional Programming, 4(2):127–206, 1994.zbMATHCrossRefMathSciNetGoogle Scholar
  5. [Bru97]
    Kim B. Bruce. Increasing Java's expressiveness with ThisType and matchbounded polymorphism. Technical report, Williams College, 1997. Available via http://www.cs.williams.edu/~kim/README.html.Google Scholar
  6. [Bru97b]
    Kim B. Bruce. Safe static type checking with systems of mutually recursive classes and inheritance. Technical report, Williams College, 1997.Google Scholar
  7. [BSvG95]
    Kim B. Bruce, Angela Schuett, and Robert van Gent. PolyTOIL: A type-safe polymorphic object-oriented language, extended abstract. In European Conference on Object-Oriented Programming, pages 27–51, LNCS 952, Springer-Verlag, 1995.Google Scholar
  8. [CCHOM89]
    Peter Canning, William Cook, Walter Hill, Walter Olthoff, and John C. Mitchell, F-bounded polymorphism for object-oriented programming. In Conference on Functional Programming Languages and Computer Architecture, pages 273–280, ACM, 1989.Google Scholar
  9. [CS97]
    Corky Cartwright and Guy Steele. Yet another parametric types proposal. Message to Java genericity mailing list, August, 1997.Google Scholar
  10. [GRJV94]
    Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns. Addison-Wesley, 1995.Google Scholar
  11. [KM96]
    Andrew Koenig and Barbara Moo. Ruminations on C++. Addison-Wesley, 1996.Google Scholar
  12. [KMMN83]
    B. B. Kristensen, O. L. Madsen, B. Møller-Pedersen, and K. Nygaard. Abstraction mechanisms in the Beta programming language. In Symposium on Principles of Programming Languages, ACM, 1983.Google Scholar
  13. [MBL97]
    Andrew C. Myers, Joseph A. Bank, and Barbara Liskov. Parameterized types for Java. In Symposium on Principles of Programming Languages, pages 132–145, ACM, 1997.Google Scholar
  14. [MM89]
    O. L. Madsen and B. Møller-Pedersen. Virtual classes: A powerful mechanism for object-oriented programming. In Object-Oriented Programming: Systems, Languages, and Applications, ACM, 1989.Google Scholar
  15. [MMN93]
    O. L. Madsen, B. Møller-Pedersen, and K. Nygaard. Object-Oriented Programming in the Beta Programming Language. Addison-Wesley, 1993.Google Scholar
  16. [OW97]
    Martin Odersky and Philip Wadler. Pizza into Java: Translating theory into practice. In Symposium on Principles of Programming Languages, pages 146–159, ACM, 1997.Google Scholar
  17. [OW98]
    Martin Odersky and Philip Wadler. Leftover Curry and reheated Pizza: How functional programming nourishes software reuse. In IEEE Fifth International Conference on Software Reuse, Vancouver, BC, June 1998.Google Scholar
  18. [PS94]
    Jens Palsberg and Michael I. Schwartzbach. Object-Oriented Type Systems. Wiley, 1994.Google Scholar
  19. [RV98]
    Didier Rémy and JérÔme Vouillon. Objective ML: An effective object-oriented extension to ML. Theory and Practice of Object-Oriented Systems, 4(1): 27–50, 1998.CrossRefGoogle Scholar
  20. [Rey74]
    J. C. Reynolds, Towards a theory of type structure. In B. Robinet, editor, Proc. Colloque sur la Programmation, LNCS 19, Springer-Verlag.Google Scholar
  21. [Rey83]
    J. C. Reynolds, Types, abstraction, and parametric polymorphism. In R. E. A. Mason, editor, Information Processing 83, pp. 513–523. North-Holland, Amsterdam.Google Scholar
  22. [Str67]
    C. Strachey, Fundamental concepts in programming languages. Lecture notes for International Summer School in Computer Programming, Copenhagen, August 1967.Google Scholar
  23. [Tho97]
    Kresten Krab Thorup. Genericity in Java with virtual types. In European Conference on Object-Oriented Programming, pages 444–471, LNCS 1241, Springer-Verlag, 1997.Google Scholar
  24. [Tor98]
    Mads Torgersen. Virtual types are statically safe. 5th Workshop on Foundations of Object-Oriented Languages, January 1998.Google Scholar
  25. [TT98]
    Kresten Krab Thorup and Mads Torgersen. Structural virtual types. Informal session on types for Java, 5th Workshop on Foundations of Object-Oriented Languages, January 1998.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1998

Authors and Affiliations

  • Kim B. Bruce
    • 1
  • Martin Odersky
    • 2
  • Philip Wadler
    • 3
  1. 1.Williams CollegeWilliamstownUSA
  2. 2.University of South AustraliaAustralia
  3. 3.Bell LabsLucent TechnologiesUSA

Personalised recommendations