Abstract
We have designed and implemented a type inference algorithm for the full Self language. The algorithm can guarantee the safety and disambiguity of message sends, and provide useful information for browsers and optimizing compilers.
Self features objects with dynamic inheritance. This construct has until now been considered incompatible with type inference because it allows the inheritance graph to change dynamically. Our algorithm handles this by deriving and solving type constraints that simultaneously define supersets of both the possible values of expressions and of the possible inheritance graphs. The apparent circularity is resolved by computing a global fixed-point, in polynomial time.
The algorithm has been implemented and can successfully handle the Self benchmark programs, which exist in the “standard Self world” of more than 40,000 lines of code.
Generously supported by National Science Foundation Presidential Young Investigator Grant #CCR-8657631, by Sun Microsystems, IBM, Apple Computer, Cray Laboratories, Tandem Computers, NCR, Texas Instruments, DEC, by a research fellowship from the Natural Science Faculty of Aarhus University, and by the Danish Research Academy.
Partially supported by the Danish Research Council, DART Project (5.21.08.03).
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Ole Agesen, Lars Bak, Craig Chambers, Bay-Wei Chang, Urs Hölzle, John Maloney, Randall B. Smith, and David Ungar. The SELF programmer’s reference manual, version 2.0. Technical report, Sun Microsystems, Inc, 2550 Garcia Avenue, Mountain View, CA 94043, USA, 1992. SMLI document 93-0056. Available by anonymous ftp from self.stanford.edu.
Alan H. Borning. Classes versus prototypes in object-oriented languages. In ACM/IEEE Fall Joint Computer Conference, pages 36–40, 1986.
Craig Chambers and David Ungar. Making pure object-oriented languages practical. In Proc. OOPSLA’91, ACM SIGPLAN Sixth Annual Conference on Object-Oriented Programming Systems, Languages and Applications, pages 1–15, 1991.
Craig Chambers, David Ungar, Bay-Wei Chang, and Urs Hölzle. Parents are Shared Parts of Objects: Inheritance and Encapsulation in Self. In Lisp and Symbolic Computation 4(3), pages 207–222, Kluwer Acadamic Publishers, June 1991.
Adele Goldberg and David Robson. Smalltalk-80—The Language and its Implementation. Addison-Wesley, 1983.
Justin O. Graver and Ralph E. Johnson. A type system for Smalltalk. In Seventeenth Symposium on Principles of Programming Languages, pages 136–150. ACM Press, January 1990.
Justin Owen Graver. Type-Checking and Type-Inference for Object-Oriented Programming Languages. PhD thesis, Department of Computer Science, University of Illinois at Urbana-Champaign, August 1989. UIUCD-R-89-1539.
Henry Lieberman. Using prototypical objects to implement shared behavior in object-oriented systems. In Proc. OOPSLA’86, Object-Oriented Programming Systems, Languages and Applications, pages 214–223. Sigplan Notices, 21(11), November 1986.
Nicholas Oxhøj, Jens Palsberg, and Michael I. Schwartzbach. Making type inference practical. In Proc. ECOOP’92, Sixth European Conference on Object-Oriented Programming, pages 329–349. Springer-Verlag (LNCS 615), Utrecht, The Nether lands, July 1992.
Jens Palsberg and Michael I. Schwartzbach. Object-oriented type inference. In Proc. OOPSLA’91, ACM SIGPLAN Sixth Annual Conference on Object-Oriented Programming Systems, Languages and Applications, pages 146–161, Phoenix, Arizona, October 1991.
Jens Palsberg and Michael I. Schwartzbach. Safety analysis versus type inference for partial types. Information Processing Letters, 43:175–180, 1992.
Michael I. Schwartzbach. Type inference with inequalities. In Proc. TAPSOFT’91, pages 441–455. Springer-Verlag (LNCS 493), 1991.
David Ungar and Randall B. Smith. SELF: The power of simplicity. In Proc. OOPSLA’ 87, Object-Oriented Programming Systems, Languages and Applications, pages 227–241, 1987. Also published in Lisp and Symbolic Computation 4(3), Kluwer Acadamic Publishers, June, 1991.
Jan Vitek, R. Nigel Horspool, and James S. Uhl. Compile-time analysis of object-oriented programs. In Proc. CC’92, 4th International Conference on Compiler Construction, Paderborn, Germany, pages 236–250. Springer-Verlag (LNCS 641), 1992.
Mitchell Wand. A simple algorithm and proof for type inference. Fundamentae Informaticae, X:115–122, 1987.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Agesen, O., Palsberg, J., Schwartzbach, M.I. (1993). Type Inference of Self . In: Nierstrasz, O.M. (eds) ECOOP’ 93 — Object-Oriented Programming. ECOOP 1993. Lecture Notes in Computer Science, vol 707. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-47910-4_14
Download citation
DOI: https://doi.org/10.1007/3-540-47910-4_14
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57120-9
Online ISBN: 978-3-540-47910-9
eBook Packages: Springer Book Archive