next up previous
Next: Transparency Up: Computational Reflection Previous: Reflective Architectures

  
Reflective Languages

Several object-oriented languages have already been designed or extended in order to support reflection. Languages such as KRS (3-KRS [21]), LISP (3-LISP [32], CLOS [16]), ABCL (ABCL/R [39] and ACBL/R2 [22]), AL-1/D (MMRF [24,25]), C++ (Open C++ [7,8] and Iguana [12]) and Java (MetaXa [17]) are examples of languages that provide varied levels of support to reflection.

In a totally reflective system, any kind of meta-information should be modifiable, and any such modification should reflect upon the base-level behavior, in a causally-connected way [21]. Although changing reified operations is possible even in compiled languages, changing structural meta-information is usually possible only in interpreted languages. Some interpreted reflective languages allow replacement interpreters to be written in the language itself [21,32,39]. Such interpreters may change the behavior of the built-in interpreter, and may themselves be interpreted by other replacement interpreters. These interpreters are called meta-circular interpreters.

Extending non-reflective compiled languages to support reflection usually involves some kind of source code preprocessing. Such preprocessing adds interception and control mechanisms, so that meta-objects are informed of operations sent to base-level objects and can deliver operations to them. If the original language does not provide structural meta-information, the preprocessor is also responsible for collecting it and arranging that it is available to meta-level objects at run-time.

Some reflection techniques can be used in programming languages that offer none or some very restricted form of the mechanisms used by reflective systems. These shortcomings usually restrict the form of reflection implemented, limiting the tower of meta-objects [21] to only two levels; the work by Bijnens et al [3] is an example of this restricted use of reflection. Ideally, reflective software architectures should allow infinite tower of meta-objects to be built, that is, objects have meta-objects, meta-objects have meta-meta-objects, and so on.


next up previous
Next: Transparency Up: Computational Reflection Previous: Reflective Architectures
contact the authors