Self-Interpretation and Reflection in a Statically Typed Language
نویسندگان
چکیده
Reflection is the ability of a system to perform a computation about itself. This ability typically includes a way of representing programs as data (“reification”) and of executing representations of programs (“selfinterpretation”). The interpreter is accessible to the interpreted program in the form of an “eval” function. Reflection is traditionally studied in untyped or dynamically typed languages such as LISP [4] [2], Smalltalk [3], or the λ-calculus [9]. By contrast, we consider self-interpretation and reflection in a statically typed metalanguage along the lines of [10] and [7]. Since the language is statically typed, the data structure used as a representation for programs is statically typed as well. Reflection in a statically typed context can be characterized as follows:
منابع مشابه
Efficient virtual machine support of runtime structural reflection
Increasing trends towards adaptive, distributed, generative and pervasive software have made object-oriented dynamically typed languages become increasingly popular. These languages offer dynamic software evolution by means of reflection, facilitating the development of dynamic systems. Unfortunately, this dynamism commonly imposes a runtime performance penalty. In this paper, we describe how t...
متن کاملRun-time Manipulation of Programs in a Statically-Typed Language
This article is an extended abstract of a doctoral dissertation on metaprogramming and programming language design. A metaprogramming model is studied and implemented in a statically–typed pure object– oriented programming language Zero. The object model of language is based on closures which enables metaprogramming model to achieve a high degree of dynamic manipulation, normally only found in ...
متن کاملReflection for Statically Typed Languages
An object-oriented language that permits changing the behavior of a class or of a single object is said to support computational reflection. Existing reflective facilities in object-oriented languages are either complex, type unsafe, or have a large performance penalty. We propose a simple, easy-to-understand, and statically typed model that captures much of the functionalities of other reflect...
متن کاملDynamic Reflection for a Statically Typed Language
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 attribute reference, on top of which the metalevel interface is built. The metalevel interface is bas...
متن کاملFinally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages
We have built the first family of tagless interpretations for a higher-order typed object language in a typed metalanguage (Haskell or ML) that require no dependent types, generalized algebraic data types, or postprocessing to eliminate tags. The statically type-preserving interpretations include an evaluator, a compiler (or staged evaluator), a partial evaluator, and call-by-name and call-by-v...
متن کامل