Signatures: A language extension for improving type abstraction and subtype polymorphism in C++
- 1 August 1995
- journal article
- Published by Wiley in Software: Practice and Experience
- Vol. 25 (8) , 863-889
- https://doi.org/10.1002/spe.4380250803
Abstract
C++ uses inheritance as a substitute for subtype polymorphism. We give examples where this makes the type system too inflexible. We then describe a conservative language extension that allows a programmer to define an abstract type hierarchy independent of any implementation hierarchies, to retroactively abstract over an implementation, and to decouple subtyping from inheritance. This extension gives the user more of the flexibility of dynamic typing while retaining the efficiency and security of static typing. Withdefault implementationsandviewsflexible mechanisms are provided for implementing an abstract type by different concrete class types. We first show how the language extension can be implemented in a preprocessor to a C++ compiler, and then detail and analyse the efficiency of an implementation we directly incorporated in the GNU C++ compiler.Keywords
This publication has 19 references indexed in Scilit:
- Subtyping recursive typesACM Transactions on Programming Languages and Systems, 1993
- Type matching, type-graphs, and the Schanuel conjectureACM Transactions on Programming Languages and Systems, 1992
- Modula-3 language definitionACM SIGPLAN Notices, 1992
- Report on the programming language HaskellACM SIGPLAN Notices, 1992
- An implementation of standard ML modulesPublished by Association for Computing Machinery (ACM) ,1988
- The type inference and coercion facilities in the scratchpad II interpreterPublished by Association for Computing Machinery (ACM) ,1987
- An introduction to Trellis/OwlPublished by Association for Computing Machinery (ACM) ,1986
- On understanding types, data abstraction, and polymorphismACM Computing Surveys, 1985
- Data types are valuesACM Transactions on Programming Languages and Systems, 1985
- A semantics of multiple inheritanceLecture Notes in Computer Science, 1984