A meta-language for typed object-oriented languages (original) (raw)
Related papers
Type Systems For Object-Oriented Programming Languages
1996
Object-oriented programming languages oopl's provide important support for today's large-scale software development projects. Unfortunately, the typing issues arising from the object-oriented features that provide this support are substantially di erent from those that arise in typing procedural languages. Attempts to adapt procedural type systems to object-oriented languages have resulted in languages like Simula, C++, and Object Pascal, which h a v e o v erly restrictive t ype systems. Among other things, the rigidity of these systems frequently force programmers to use type casts, which are a notorious source of hard-to-nd bugs. These restrictive type systems also mean that many programming idioms common to untyped oopl's such as Smalltalk are not typeable. One source of this lack of exibility is the con ation of subtyping and inheritance. Brie y, inheritance is an implementation technique in which new object de nitions may be given as incremental modi cations to existing de nitions. Subtyping concerns substitutivity: when can one object safely replace another? By tying subtyping to inheritance, existing oopl's greatly reduce the number of legal substitutions in a system, and hence their degree of polymorphism. Attempts to x this rigidity h a v e resulted in unsound type systems, most notably Ei el's.
Type Systems for the Object Oriented Paradigm
Citeseer, 1999
In this thesis we study some object-oriented mechanisms from the type system perspective. Our starting point is the axiomatic model of Fisher, Honsell and Mitchell, the Lambda Calculus of Objects. Following the path of recent researches on the topic, we show how some object-based language features can be happily modeled within some functional calculi, proved sound with respect to the message-not-understood error. Then, we approach the more complicated problem of modeling class constructs, presenting two proposals and discussing their respective qualities and drawbacks, together with some future directions we would like to follow to try to better understand classbased languages. precious comments and all of the discussions we had together on objects. A special thank goes to Betti Venneri (University of Firenze), for her encouragement since she has been the supervisor for my master thesis when she was still in Torino. My gratitude goes then to my external referees, Giuseppe Castagna (ENS, Paris) and Sophia Drossopoulou (Imperial College, London), for their kindness in accepting to read my manuscript and for their precious suggestions that helped me improving the presentation of my work. Last but not least, I would like to mention all the people I met during my academic path that made my life easier with their friendship and their support (following again the temporal order in which I met them for the rst time
The Development of Type Systems for Object‐Oriented Languages
Theory and Practice of Object Systems, 1995
This paper, which is partly tutorial in nature, summarizes some basic research goals in the study and development o f t yped objectoriented programming languages. These include both immediate repairs to problems with existing languages and the long-term development o f more exible and expressive, yet type-safe, approaches to program organization and design. The technical part of the paper is a summary and comparison of three object models from the literature. We conclude by discussing approaches to selected research problems, including changes in the type of a method from super class to sub class and the use of types that give information about the implementations as well as the interfaces of objects. Such implementation types seem essential for adequate typing of binary operations on objects, for example.
Some challenging typing issues in object-oriented languages
2003
In this paper we discuss some of the remaining problems in the design of static type systems for object-oriented programming languages. We look at typing problems involved in writing a simple interpreter as a good example of a simple problem leading to difficult typing issues. The difficulties encountered seem to arise in situations where a programmer desires to simultaneously refine mutually interdependent classes and object types.
Strong typing of object-oriented languages revisited
ACM SIGPLAN Notices, 1990
This paper is concerned with the relation between subtyping and subclassing and their influence on programming language design. Traditionally subclassing as introduced by Simula has also been used for defining a hierarchical type system. The type system of a language can be characterized as strong or weak and the type checking mechanism as static or dynamic . Parameterized classes in combination with a hierarchical type-system is an example of a language construct that is known to create complicated type checking situations. In this paper these situations are analyzed and several different solutions are found. It is argued that an approach with a combination of static and dynamic type checking gives a reasonable balance also here. It is also concluded that this approach makes it possible to base the type system on the class/subclass mechanism.
A paradigmatic object-oriented programming language: Design, static typing and semantics
Journal of Functional Programming, 1994
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 gui...
A simple typed intermediate language for object-oriented languages
ACM SIGPLAN Notices, 2005
Traditional class and object encodings are difficult to use in practical type-preserving compilers because of the complexity of the encodings. We propose a simple typed intermediate language for compiling object-oriented languages and prove its soundness. The key ideas are to preserve lightweight notions of classes and objects instead of compiling them away and to separate name-based subclassing from structure-based subtyping. The language can express standard implementation techniques for both dynamic dispatch and runtime type tests. It has decidable type checking even with subtyping between quantified types with different bounds. Because of its simplicity, the language is a more suitable starting point for a practical type-preserving compiler than traditional encoding techniques.
A Type-Theoretic Basis for an Object-Oriented Refinement Calculus
1996
This paper addresses the issue of giving a formal semantics to an object-oriented programming and specification language. Object-oriented constructs considered are objects with attributes and methods, encapsulation of attributes, subtyping, bounded type parameters, classes, and inheritance. Classes are distinguished from object types. Besides usual imperative statements, specification statements are included. Specification statements allow changes of variables to be described by a predicate. They are abstract in the sense that they are non-executable. Specification statements may appear in method bodies of classes, leading to abstract classes. The motivation for this approach is that abstract classes can be used for problem-oriented specification in early stages and later refined to efficient implementations. Various refinement calculi provide laws for procedural and data refinement, which can be used here for class refinement. This paper, however, focuses on the semantics of object-oriented programs and specifications and gives some examples of abstract and concrete classes. The semantics is given by a translation of the constructs into the type system F≤, an extension of the simple typed λ-calculus by subtyping and parametric polymorphism: The state of a program is represented by a record. A state predicate is a Boolean valued function from states. Statements, both abstract and concrete, are represented by predicate transformers, i. e. higher order functions mapping state predicates (postconditions) to state predicates (preconditions). Objects are represented by records of statements (the methods) operating on a record of attributes, where the attributes are hidden by existential quantification. Classes are understood as templates for the creation of objects. Classes are represented by records. Inheritance amounts to record overwriting. Subtyping and parametric polymorphism, e. g. for the parameterization of classes by types, are already present in F≤. The advantage of this semantic by translation is that it builds on the features already provided by F≤ (which are all used). Hence no direct reference to the model underlying F≤ needs to be made; a summary of the syntax and rules of F≤ is given.
Understanding Object-Oriented Languages: Semantics and Types
Lecture Notes, December, 1998
In this document we hope to explore the foundations of object-oriented programming languages by providing a way of understanding these languages via a translation to an extended typed lambda calculus. We will start with a quite simple encoding of objects and classes, and then see that support for such features as subclasses and parametric polymorphism will push us into more complex encodings. Moreover these encodings will suggest the addition of new extensions (eg, MyType) to object-oriented programming ...
1994
This paper gives an introduction to type theory, focusing on its recent use as a logical framework for proofs and programs. The first two sections give a background to type theory intended for the reader who is new to the subject. The following presents Martin-Lof's monomorphic type theory and an implementation, ALF, of this theory. Finally, a few small tutorial examples in ALF are given.