Abstract
We integrate existential types into a strongly typed C-like language. In particular, we show how a bad combination of existential types, mutation, and aliasing can cause a subtle violation of type safety. We explore two independent ways to strengthen the type system to restore safety. One restricts the mutation of existential packages. The other restricts the types of aliases of existential packages. We use our framework to explain why other languages with existential types are safe.
This material is based on work supported in part by AFOSR under grant F49620- 00-1-0198. Any opinions, findings, and conclusions or recommendations expressed in this publications are those of the author and do not reflect the view of this agency.
Chapter PDF
References
Kim B. Bruce, Luca Cardelli, and Benjamin C. Pierce. Comparing object encodings. Information and Computation, 155:108–133, 1999.
Robert DeLine and Manuel Fähndrich. Enforcing high-level protocols in low-level software. In ACM Conference on Programming Language Design and Implementation, pages 59–69, Snowbird, UT, June 2001.
Dan Grossman. Existential types for imperative languages: Technical results. Technical Report 2001-1854, Cornell University Computer Science, October 2001.
Robert Harper. A simplified account of polymorphic references. Information Processing Letters, 51(4):201–206, August 1994.
Trevor Jim, Greg Morrisett, Dan Grossman, Michael Hicks, James Cheney, and Yanling Wang. Cyclone: A safe dialect of C. In 2002 USENIX Annual Technical Conference, Monterey, CA, June 2002. To appear.
Konstantin Läufer. Type classes with existential types. Journal of Functional Programming, 6(3):485–517, May 1996.
B. Liskov et al. CLU Reference Manual. Springer-Verlag, 1984.
Robin Milner, Mads Tofte, Robert Harper, and David MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997.
Yasuhiko Minamide, Greg Morrisett, and Robert Harper. Typed closure conversion. In 23rd ACM Symposium on Principles of Programming Languages, pages 271–283, St. Petersburg, FL, January 1996.
J.C. Mitchell and G.D. Plotkin. Abstract types have existential type. ACM Transactions on Programming Languages and Systems, 10(3):470–502, 1988. Preliminary version in 12th ACM Symposium on Principles of Programming Languages, 1985.
Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From System F to typed assembly language. ACM Transactions on Programming Languages and Systems, 21(3):528–569, May 1999.
Geoffrey Smith and Dennis Volpano. Towards an ML-style polymorphic type system for C. In 6th European Symposium on Programming, volume 1058 of Lecture Notes in Computer Science, pages 341–355, Linköping, Sweden, April 1996. Springer-Verlag.
Geoffrey Smith and Dennis Volpano. A sound polymorphic type system for a dialect of C. Science of Computer Programming, 32(2–3):49–72, 1998.
Mads Tofte. Type inference for polymorphic references. Information and Computation, 89:1–34, November 1990.
David Walker and Greg Morrisett. Alias types for recursive data structures. In Workshop on Types in Compilation, volume 2071 of Lecture Notes in Computer Science, pages 177–206, Montreal, Canada, September 2000. Springer-Verlag.
Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38–94, 1994.
Hongwei Xi. Imperative programming with dependent types. In 15th IEEE Symposium on Logic in Computer Science, pages 375–387, Santa Barbara, CA, June 2000.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Grossman, D. (2002). Existential Types for Imperative Languages. In: Le Métayer, D. (eds) Programming Languages and Systems. ESOP 2002. Lecture Notes in Computer Science, vol 2305. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45927-8_3
Download citation
DOI: https://doi.org/10.1007/3-540-45927-8_3
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-43363-7
Online ISBN: 978-3-540-45927-9
eBook Packages: Springer Book Archive