Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Reification (computer science)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Reflective programming languages == In the context of [[programming language]]s, 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 [[Reflection (computer science)|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 {{clarification needed|date=April 2017}}. Reification data is often said to be made a [[first class object]]{{citation needed|date=April 2017}}. Reification, at least partially, has been experienced in many languages to date: in early [[Lisp (programming language)|Lisp dialects]] and in current [[Prolog| 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.<ref>J. Malenfant, M. Jacques and F.-N. Demers, [http://www2.parc.com/csl/groups/sda/projects/reflection96/docs/malenfant/ref96/ref96.html A Tutorial on Behavioral Reflection and its Implementation] {{webarchive|url=https://web.archive.org/web/20100528214857/http://www2.parc.com/csl/groups/sda/projects/reflection96/docs/malenfant/ref96/ref96.html |date=2010-05-28 }}</ref> * The [[C (programming language)|C programming language]] reifies the low-level detail of [[memory address]]es.{{paragraph break}}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 0xB8000000.{{paragraph break}}<syntaxhighlight lang="c"> char* buffer = (char*) 0xB8000000; buffer[0] = 10; </syntaxhighlight> * [[Functional programming languages]] based on [[lambda-calculus]] reify the concept of a procedure abstraction and procedure application in the form of the [[Lambda calculus#Lambda calculus and programming languages|Lambda expression]]. * The [[Scheme (programming language)|Scheme]] programming language reifies [[continuations]] (approximately, the call stack). * In [[C Sharp (programming language)|C#]], reification is used to make [[parametric polymorphism]] implemented in the form of generics as a first-class feature of the language. * In the [[Java (programming language)|Java]] programming language, there exist "reifiable types" that are "completely available at run time" (i.e. their information is not erased during compilation).<ref>[http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.7 The Java Language Specification, section 4.7], Java SE 7 Edition</ref> * [[REBOL]] reifies code as data and vice versa. * Many languages, such as [[Lisp (programming language)|Lisp]], [[JavaScript]], and [[Curl (programming language)|Curl]], provide an [[eval|<code>eval</code> or <code>evaluate</code> 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 model|Actor languages]] permit the reification of blocks and [[message passing|messages]],<ref>{{cite web|url=http://c2.com/cgi/wiki?SmalltalkBlocksAndClosures |title=Smalltalk Blocks And Closures |publisher=C2.com |date=2009-10-15 |accessdate=2010-10-09}}</ref> which are equivalent of lambda expressions in Lisp, and <code>thisContext</code> in Smalltalk, which is a reification of the current executing block. * [[Homoiconicity|Homoiconic languages]] reify the syntax of the language as data that is understood by the language itself. This allows the user to write programs whose inputs and outputs are code (see [[Macro (computer science)|macros]], [[eval]]). Common representations of code include [[S-Expression|S-expressions]] (e.g. [[Clojure]], [[Lisp]]), and [[abstract syntax tree|abstract syntax trees]] (e.g [[Rust]]).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)