In recent years, object-oriented programming has emerged as
the dominant computer programming style, and
object-oriented
languages such as
C++ and
Java enjoy wide
use in academia and industry. This text explores the formal
underpinnings of object-oriented languages to help the
reader understand the fundamental concepts of these
languages and the design decisions behind them. The text
begins by analyzing existing object-oriented languages,
paying special attention to their
type systems and
impediments to expressiveness. It then examines two key
features: subtypes and subclasses. After a brief
introduction to the lambda calculus, it presents a
prototypical object-oriented language,
SOOL, with a simple
type system similar to those of class-based object-oriented
languages in common use.The text offers proof that the type
system is sound by showing that the semantics preserves
typing information. It concludes with a discussion of
desirable features, such as parametric polymorphism and a
MyType construct, that are not yet included in most
statically typed object-oriented
languages.
ContentsI: Type Problems in
Object-Oriented Languages Introduction
- Fundamental Concepts of Object-Oriented Languages
- Type Problems in Object-Oriented Languages
- Adding Expressiveness to Object-Oriented Languages
- Understanding Subtypes
- Type Restrictions on Subclasses
- Varieties of Object-Oriented Programming Languages
- Historical Notes and References for Section I
II: Foundations: The Lambda Calculus
- Formal Language Descriptions and the Lambda
Calculus
- The Polymorphic Lambda Calculus
- Historical Notes and References for Section II
III: Formal Descriptions of Object-Oriented Languages
- SOOL, a Simple Object-Oriented Language
- A Simple Translational Semantics of Objects and
Classes
- Improved Semantics for Classes
- SOOL's Type System Is Safe (and Sound)
- Completing SOOL: super, nil, Information Hiding, and
Multiple Inheritance
- Historical Notes and Reference for Section III
IV: Extending Simple Object-Oriented Languages
- Adding Bounded Polymorphism to SOOL
- Adding MyType to Object-Oriented Programming
Languages
- Match-Bounded Polymorphism
- Simplifying: Dropping Subtyping for Matching
- Historical Notes and References for Section IV