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.
Kim Bruce's research was partially supported by NSF grant CCR-9424123.
Preview
Unable to display preview. Download preview PDF.
References
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.
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.
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.
Kim B. Bruce. A paradigmatic object-oriented programming language: design, static typing and semantics. Journal of Functional Programming, 4(2):127–206, 1994.
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.
Kim B. Bruce. Safe static type checking with systems of mutually recursive classes and inheritance. Technical report, Williams College, 1997.
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.
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.
Corky Cartwright and Guy Steele. Yet another parametric types proposal. Message to Java genericity mailing list, August, 1997.
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns. Addison-Wesley, 1995.
Andrew Koenig and Barbara Moo. Ruminations on C++. Addison-Wesley, 1996.
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.
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.
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.
O. L. Madsen, B. Møller-Pedersen, and K. Nygaard. Object-Oriented Programming in the Beta Programming Language. Addison-Wesley, 1993.
Martin Odersky and Philip Wadler. Pizza into Java: Translating theory into practice. In Symposium on Principles of Programming Languages, pages 146–159, ACM, 1997.
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.
Jens Palsberg and Michael I. Schwartzbach. Object-Oriented Type Systems. Wiley, 1994.
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.
J. C. Reynolds, Towards a theory of type structure. In B. Robinet, editor, Proc. Colloque sur la Programmation, LNCS 19, Springer-Verlag.
J. C. Reynolds, Types, abstraction, and parametric polymorphism. In R. E. A. Mason, editor, Information Processing 83, pp. 513–523. North-Holland, Amsterdam.
C. Strachey, Fundamental concepts in programming languages. Lecture notes for International Summer School in Computer Programming, Copenhagen, August 1967.
Kresten Krab Thorup. Genericity in Java with virtual types. In European Conference on Object-Oriented Programming, pages 444–471, LNCS 1241, Springer-Verlag, 1997.
Mads Torgersen. Virtual types are statically safe. 5th Workshop on Foundations of Object-Oriented Languages, January 1998.
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.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bruce, K.B., Odersky, M., Wadler, P. (1998). A statically safe alternative to virtual types. In: Jul, E. (eds) ECOOP’98 — Object-Oriented Programming. ECOOP 1998. Lecture Notes in Computer Science, vol 1445. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0054106
Download citation
DOI: https://doi.org/10.1007/BFb0054106
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-64737-9
Online ISBN: 978-3-540-69064-1
eBook Packages: Springer Book Archive