Skip to main content
×
Home
    • Aa
    • Aa

A paradigmatic object-oriented programming language: Design, static typing and semantics

  • Kim B. Bruce (a1)
Abstract
Abstract

To illuminate the fundamental concepts involved in object-oriented programming languages, we describe the design of TOOPL, a paradigmatic, statically-typed, functional, object-oriented programming language which supports classes, objects, methods, hidden instance variables, subtypes and inheritance.

It has proven to be quite difficult to design such a language which has a secure type system. A particular problem with statically type checking object-oriented languages is designing typechecking rules which ensure that methods provided in a superclass will continue to be type correct when inherited in a subclass. The type-checking rules for TOOPL have this feature, enabling library suppliers to provide only the interfaces of classes with actual executable code, while still allowing users to safely create subclasses. To achieve greater expressibility while retaining type-safety, we choose to separate the inheritance and subtyping hierarchy in the language.

The design of TOOPL has been guided by an analysis of the semantics of the language, which is given in terms of a model of the F-bounded second-order lambda calculus with fixed points at both the element and type level. This semantics supports the language design by providing a means to prove that the type-checking rules are sound, thus guaranteeing that the language is type-safe.

While the semantics of our language is rather complex, involving fixed points at both the element and type level, we believe that this reflects the inherent complexity of the basic features of object-oriented programming languages. Particularly complex features include the implicit recursion inherent in the use of the keyword, self, to refer to the current object, and its corresponding type, MyType. The notions of subclass and inheritance introduce the greatest semantic complexities, whereas the notion of subtype is more straightforward to deal with. Our semantic investigations lead us to recommend caution in the use of inheritance, since small changes to method definitions in subclasses can result in major changes to the meanings of the other methods of the class.

Copyright
References
Hide All
Abadi M. (1992) Doing without F-bounded quantification. Message to Types electronic mail list, February.
Abadi M. (1994) Baby modula-3 and a theory of objects. J. Functional Program. to appear.
Abadi M. and Plotkin G.D. (1990) A PER model of polymorphism and recursive types. In: Proc. Symp. on Logic in Comput. Sci., pp. 355365.
Amadio R.M. (1991) Recursion over realizability structures. Infor. and Computation 91(1): 5586.
Amadio R. and Cardelli L. (1993) Subtyping recursive types. ACM TOPLAS 15(4): 575631.
America P. (1987) Inheritance and subtyping in a parallel object-oriented language. In: Bezivin J. et al. , Eds., Proc. ECOOP '87 – Lecture Notes in Computer Science 276, pp. 234242, Springer.
America P., de Bakker J., Kok J. and Rutten J. (1986) Operational semantics of a parallel object-oriented language. In: Proc. 13th ACM Symp. on Principles of Program. Lang., pp. 194208.
America P., de Bakker J., Kok J. and Rutten J. (1989) Denotational semantics of a parallel object-oriented language. Infor. and Computation 83(2): 152205.
America P. and van der Linden F. (1990) A parallel object-oriented language with inheritance and subtyping. In: OOPSLA-ECOOP '90 Proceedings, pp. 161168, October. (ACM SIGPLAN Not. 25(10).)
Birtwistle G.M., Dahl O.-J., Myhrhaug B. and Nygaard K. (1973) SIMULA Begin. Aurbach.
Black A. (1992) Private communication.
Black A. and Hutchinson N. (1991) Typechecking polymorphism in Emerald. Technical Report CRL 91/1 (Revised), DEC Cambridge Research Lab.
Black A., Hutchinson N., Jul E. and Levy H. (1986) Object structure in the Emerald system. In: Proc. ACM Symp. on Object-Oriented Program.: Syst., Lang. and Applic., pp. 7886, October.
Breazu-Tannen U., Coquand T., Gunter C.A. and Scedrov A. (1989) Inheritance and explicit coercion. In: Proc. 4th IEEE Symp. Logic in Comput. Sci., pp. 112129.
Breazu-Tannen U., Coquand T., Gunter C.A. and Scedrov A. (1991) Inheritance and implicit coercion. Infor. and Computation 93(1): 172221.
Bruce K. (1992) The equivalence of two semantic definitions of inheritance in object-oriented languages. In: Brookes S. Main M., Melton A., Mislove M. and Schmidt D., Eds., Proc. 7th Int. Conf. on Mathematical Foundations of Program. Semantics – Lecture Notes in Computer Science 598, pp. 102124, Springer.
Bruce K., Crabtree J., Dimock A., Muller R., Murtagh T. and van Gent R. (1993) Safe and decidable type checking in an object-oriented language. In: Proc. ACM Symp. on Object-Oriented Program.: Syst., Lang. and Applic., pp. 2946.
Bruce K., Crabtree J. and Kanapathy G. (1993) An operational semantics for TOOPLE: A statically-typed object-oriented programming language. In: Proc. MFPS IX, to appear.
Bruce K. and Longo G. (1988) A modest model of records, inheritance and bounded quantification. In: Proc. 3rd IEEE Symp. Logic in Comput. Sci., pp. 3851.
Bruce K. and Longo G. (1990) A modest model of records, inheritance and bounded quantification. Infor. and Computation 87(1/2): 196240.
Bruce K.B., Meyer A.R. and Mitchell J.C. (1990) The semantics of second-order lambda calculus. Infor. and Computation 85(1): 76134. (Reprinted in G. Huet, Ed., Logical Foundations of Functional Programming, Addison-Wesley, Reading, MA, 1990, pp. 213–273.)
Bruce K.B. and Mitchell J.M. (1992) PER models of subtyping, recursive types and higher-order polymorphism. In: Proc. ACM Symp. on Principles of Program. Lang., pp. 316327.
Bruce K.B. and van Gent R. (1993) TOIL: A new type-safe object-oriented imperative language. To appear.
Canning P., Cook W., Hill W., Mitchell J. and Olthoff W. (1989) F-bounded quantification for object-oriented programming. In: Functional Prog. and Computer Architecture, pp. 273280.
Canning P., Cook W., Hill W. and Olthoff W. (1989) Interfaces for strongly-typed object-oriented programming. In: Proc. ACM Conf. on Object-Oriented Program.: Syst., Lang. and Applic, pp. 457467.
Cardelli L. (1988a) A semantics of multiple inheritance. Infor. and Computation 76: 138164. (Special issue devoted to Symp. on Semantics of Data Types, Sophia-Antipolis (France), 1984.)
Cardelli L. (1988b) Structural subtyping and the notion of powertype. In: Proc. 15th ACM Symp. Principles of Program. Lang., pp. 7079.
Cardelli L. (1992a) Extensible records in a pure calculus of subtyping. Technical Report 81, DEC Systems Research Center.
Cardelli L. (1992b) Typed foundations of object-oriented programming, 1992. Tutorial given at POPL '92.
Cardelli L., Donahue J., Galssman L., Jordan M., Kalsow B. and Nelson G. (1988) Modula-3 report. Technical Report SRC-31, DEC systems Research Center.
Cardelli L. and Longo G. (1991) A semantic basis for Quest. J. Functional Program. 1(4): 417458.
Cardelli L. and Mitchell J. C. (1990) Operations on records. In: Math. Foundations of Prog. Lang. Semantics – Lecture Notes in Computer Science 442, pp. 2252. Springer.
Cardelli L. and Wegner P. (1985) On understanding types, data abstraction, and polymorphism. Comput. Surv. 17(4): 471522.
Cardone F. (1989) Relational semantics for recursive types and bounded quantification. In: ICALP – Lecture Notes in Computer Science 372, pp. 164178, Springer.
Castagna G., Ghelli G. and Longo G. (1991) A calculus for overloaded functions with subtyping. Technical report, Ecole Normale Superieure.
Castagna G. and Pierce B. (1994) Decidable bounded quantification. In: Proc. ACM Symp. on Principles of Program. Lang.
Cook W.R. (1989a) A Denotational Semantics of Inheritance. PhD thesis, Brown University.
Cook W.R. (1989b) A proposal for making Eiffel type-safe. In: Euro. Conf. on Object-Oriented Program., pp. 5772.
Cook W.R., Hill W.L. and Canning P.S. (1990) Inheritance is not subtyping. In: Proc. 17th ACM Symp. on Principles of Program. Lang., pp. 125135, January.
Cook W. and Palsberg J. (1989) A denotational semantics of inheritance and its correctness. In: Proc. ACM Conf. on Object-Oriented Program.: Syst., Lang. and Applic., pp. 433444.
Cox B. (1986) Object-Oriented Programming; An evolutionary appoach. Addison-Wesley, Reading, MA.
Curien P.L. and Ghelli G. (1992) Coherence of subsumption, minimum typing and type-checking in F . Mathematical Structures in Comput. Sci. 2: 5591.
Danforth S. and Tomlinson C. (1988) Type theories and object-oriented programming. ACM Comput. Surv. 20(1): 2972.
Dimock A. and Muller R. (1992) Private communication.
Ghelli G. (1991) A static type system for message passing. In: OOPSLA Proc., pp. 129145. (ACM SIGPLAN Not. 26(11), November.)
Goldberg A. and Robson D. (1983) Smalltalk–80: The language and its implementation. Addison Wesley, Reading, MA.
Gunter C.A. (1992) Semantics of Programming Languages: Structures and Techniques. MIT Press, Cambridge, MA.
Hense A.V. (1990) Denotational semantics of an object oriented programming language with explicit wrappers. Technical Report A 11/90, Universitat des Saarlandes.
Hense A.V. (1991) Wrapper semantics of an object oriented programming language with state. In: TACS Proc., pp. 548568, Springer.
Kamin S. (1988) Inheritance in Smalltalk-80: a denotational definition. In: ACM Symp. Principles of Program. Lang., pp. 8087.
Kozen D., Palsberg J. and Schwartzbach M.I. (1993) Efficient recursive subtyping. In: 20th ACM Symp. Principles of Program. Lang.
Liskov B. (1988) Data abstraction and hierarchy. In: OOPSLA Addendum to Proc., pp. 1734. (ACM SIGPLAN Not. 23(5), May.)
Madsen O., Magnusson B. and Moller-Pedersen B. (1990) Strong typing of object-oriented languages revisited. In: OOPSLA-ECOOP Proc., pp. 140150. (ACM SIGPLAN Not. 25(10), October.
Meyer B. (1988) Object-Oriented Software Construction. Prentice-Hall, Englewood Cliffs, NJ.
Meyer B. (1992) Eiffel: The language. Prentice-Hall, Englewood Cliffs, NJ.
Mitchell J.C. (1984) Type inference and type containment. In: Proc. Int. Symp. on Semantics of Data Types – Lecture Notes in Computer Science 173, Sophia-Antipolis, France, pp. 257278, June, Springer.
Mitchell J.C. (1988) Polymorphic type inference and containment. Infor. and Computation 76(2/3): 211249. (Reprinted in G. Huet, Ed., Logical Foundations of Functional Programming, Addison-Wesley, Reading, MA, 1990, pp. 153–194.)
Mitchell J.C. (1990a) Toward a typed foundation for method specialization and inheritance. In: Proc. 17th ACM Symp. on Principles of Progra. Lang., pp. 109124, January.
Mitchell J.C. (1990b) Type systems for programming languages. In: van Leeuwen J., Ed., Handbook of Theoretical Computer Science, Volume B, pp. 365458, North-Holland, Amsterdam.
Mitchell J.C. and Plotkin G.D. (1988) Abstract types have existential types. ACM Trans. Program. Lang. and Syst. 10(3): 470502. (Preliminary version appeared in Proc. 12th ACM Symp. on Principles of Program. Lang.)
Moon D. (1986) Object-oriented programming with flavors. In: Proc. ACM Conf. on Object-Oriented Program.: Syst., Lang. and Applic., pp. 19.
Omohundro S.M. (1991) The Sather language. Technical report, International Computer Science Institute.
Palsberg J. and Schwartzback M. (1990) Type substitution for object-oriented programming. In: OOPSLA-ECOOP Proc., pp. 151160. (ACM SIGPLAN Not. 25(10), October.)
Palsberg J. and Schwartzback M. (1991) Static typing for object-oriented programming. Technical report, Aarhus University Computer Science Department.
Pierce B.C. (1992) Bounded quantification is undecidable. In: Proc. 19th ACM Symp. Principles of Program. Lang., pp. 305315.
Pierce B.C. and Hoffman M. (1992) An abstract view of objects and subtyping (preliminary report). Technical Report ECS-LFCS-92-226, University of Edinburgh.
Pierce B.C. and Turner D.N. (1992a) Simple type-theoretic foundations for object-oriented programming. Technical report, University of Edinburgh.
Pierce B.C. and Turner D.N. (1992b) Statically typed multi-methods via partially abstract types. Technical Report, University of Edinburgh.
Pierce B.C. and Turner D.N. (1993) Object-oriented programming without recursive types. In: Proc 20th ACM Symp. Principles of Program. Lang., pp. 299312.
Reddy U.S. (1988) Objects as closures: Abstract semantics of object-oriented languages. In: Proc. ACM Symp. Lisp and Functional Program. Lang., pp. 289297, July.
Reynolds J.C. (1980) Using category theory to design implicit conversions and generic operators. In Jones N.D., Ed., Semantics-Directed Compiler Generation – Lecture Notes in Computer Science 94, pp. 2112580, Springer.
Schaffert C., Cooper T., Bullis B., Kilian M. and Wilpolt C. (1986) An introduction to Trellis/Owl. In: OOPSLA Proc., pp. 916. (ACM SIGPLAN Not. 21(11), November.)
Snyder A. (1986) Encapsulation and inheritance in object-oriented programming languages. In: Proc. 1st ACM Symp. on Object-Oriented Program. Syst., Lang, and Applic., pp. 3846, October.
Stroustrop B. (1986) The C++ Programming Language. Addison-Wesley, Reading, MA.
Tesler L. (1985) Object Pascal report. Technical Report 1, Apple Computer.
van Gent R. (1993) TOIL: An imperative type-safe object-oriented language. Williams College Senior Honors Thesis.
Wegner P. (1990) Concepts and paradigms of object-oriented programming. OOPS Messenger 1(1): 787, August.
Wirth N. (1988) The programming language Oberon. Software - Practice and Experience 18: 671690.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 17 *
Loading metrics...

Abstract views

Total abstract views: 137 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 19th October 2017. This data will be updated every 24 hours.