scholarly journals Dynamic Reflection for a Statically Typed Language

1996 ◽  
Vol 25 (505) ◽  
Author(s):  
Søren Brandt ◽  
Rene Wenzel Schmidt

We present a runtime metalevel interface for BETA. BETA is a compiled and statically typed object-oriented programming language. The metalevel interface preserves the type safe properties of the language and supports static type checking. This is achieved through a novel language construct, the <em>attribute reference</em>, on top of which the metalevel interfacer is built. The metalevel interface is based on a simple conceptual model that reifies a few basic language primitives. For the implementation, a metalevel architecture based on a virtual machine view of the runtime system is introduced. In this model, an open implementation of compiled language is achieved by providening the runtime virtual machine with a metalevel interface supporting runtime reflection.

1994 ◽  
Vol 4 (2) ◽  
pp. 127-206 ◽  
Author(s):  
Kim B. Bruce

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.


1991 ◽  
Vol 57 (3-4) ◽  
pp. 221-236 ◽  
Author(s):  
Masahiko Sekine ◽  
Hiroshi Nakanishi ◽  
Masao Ukita ◽  
Sadaaki Murakami

Sign in / Sign up

Export Citation Format

Share Document