Skip to main content

Type Inference of Self

Analysis of Objects with Dynamic and Multiple Inheritance

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 707))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.

    Google Scholar 

  2. Alan H. Borning. Classes versus prototypes in object-oriented languages. In ACM/IEEE Fall Joint Computer Conference, pages 36–40, 1986.

    Google Scholar 

  3. 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.

    Google Scholar 

  4. 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.

    Article  Google Scholar 

  5. Adele Goldberg and David Robson. Smalltalk-80—The Language and its Implementation. Addison-Wesley, 1983.

    Google Scholar 

  6. 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.

    Google Scholar 

  7. 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.

    Google Scholar 

  8. 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.

    MathSciNet  Google Scholar 

  9. 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.

    Chapter  Google Scholar 

  10. 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.

    Google Scholar 

  11. Jens Palsberg and Michael I. Schwartzbach. Safety analysis versus type inference for partial types. Information Processing Letters, 43:175–180, 1992.

    Article  MATH  MathSciNet  Google Scholar 

  12. Michael I. Schwartzbach. Type inference with inequalities. In Proc. TAPSOFT’91, pages 441–455. Springer-Verlag (LNCS 493), 1991.

    Google Scholar 

  13. 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.

    Google Scholar 

  14. 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.

    Google Scholar 

  15. Mitchell Wand. A simple algorithm and proof for type inference. Fundamentae Informaticae, X:115–122, 1987.

    MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics