Reification and Reflective Programming Languages
In the context of programming languages, reification is the process by which a user program or any aspect of a programming language that was implicit in the translated program and the run-time system, are expressed in the language itself. This process makes it available to the program, which can inspect all these aspects as ordinary data. In reflective languages, reification data is causally connected to the related reified aspect such that a modification to one of them affects the other. Therefore, the reification data is always a faithful representation of the related reified aspect. Reification data is often said to be made a first class object. Reification, at least partially, has been experienced in many languages to date: in early Lisp dialects and in current Prolog dialects, programs have been treated as data, although the causal connection has often been left to the responsibility of the programmer. In Smalltalk-80, the compiler from the source text to bytecode has been part of the run-time system since the very first implementations of the language.
- The C programming language reifies the low-level detail of memory addresses.
-
- Many programming language designs encapsulate the details of memory allocation in the compiler and the run-time system. In the design of the C programming language, the memory address is reified and is available for direct manipulation by other language constructs. For example, the following code may be used when implementing a memory-mapped device driver. The buffer pointer is a proxy for the memory address 0xB800000.
- Functional programming languages based on lambda-calculus reify the concept of a procedure abstraction and procedure application in the form of the Lambda expression.
- The Scheme programming language reifies continuations (approximately, the call stack).
- In C#, reification is used to make parametric polymorphism implemented as generics as a first-class feature of the language.
- In Java programming language, there exist "reifiable types" that are "completely available at run time" (i.e. their information is not erased during compilation).
- REBOL reifies code as data and vice-versa.
- Many languages, such as Curl, JavaScript, and Lisp provide an
eval
orevaluate
procedure that effectively reifies the language interpreter. - The Logtalk framework for Prolog offers a means to explore reification in the context of logic programming.
- Smalltalk and Actor languages permit the reification of blocks and messages, which are equivalent of lambda expressions in Lisp, and thisContext which is a reification of the current executing block.
Read more about this topic: Reification (computer Science)
Famous quotes containing the words reflective, programming and/or languages:
“Be reflective ... and stay away from the theater as much as you can. Stay out of the theatrical world, out of its petty interests, its inbreeding tendencies, its stifling atmosphere, its corroding influence. Once become theatricalized, and you are lost, my friend; you are lost.”
—Minnie Maddern Fiske (18651932)
“If there is a price to pay for the privilege of spending the early years of child rearing in the drivers seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.”
—Melinda M. Marshall (20th century)
“No doubt, to a man of sense, travel offers advantages. As many languages as he has, as many friends, as many arts and trades, so many times is he a man. A foreign country is a point of comparison, wherefrom to judge his own.”
—Ralph Waldo Emerson (18031882)