Abstract
AbstractTo 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.
Publisher
Cambridge University Press (CUP)
Reference78 articles.
1. The semantics of second-order lambda calculus
2. Bruce K.B. and van Gent R. (1993) TOIL: A new type-safe object-oriented imperative language. To appear.
3. Subtyping recursive types
Cited by
72 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Recursive Subtyping for All;Proceedings of the ACM on Programming Languages;2023-01-09
2. Facilitating Connector Evolution With Architecture-Centric Development;2021 IEEE 18th International Conference on Software Architecture Companion (ICSA-C);2021-03
3. Software for Structure Selection of an Artificial Neural Network to Control the Induction Soldering Process;Software Engineering Perspectives in Intelligent Systems;2020
4. Familia: unifying interfaces, type classes, and family polymorphism;Proceedings of the ACM on Programming Languages;2017-10-12
5. Classless Java;ACM SIGPLAN Notices;2017-05-12