Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Interpreter (computing)
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
===Self-interpreter=== {{main|Meta-circular evaluator}} A self-interpreter is a [[programming language]] interpreter written in a programming language which can interpret itself; an example is a [[BASIC programming language|BASIC]] interpreter written in BASIC. Self-interpreters are related to [[Self-hosting (compilers)|self-hosting compiler]]s. If no [[compiler]] exists for the language to be interpreted, creating a self-interpreter requires the implementation of the language in a host language (which may be another programming language or [[Assembler (computing)|assembler]]). By having a first interpreter such as this, the system is [[Bootstrapping (compilers)|bootstrapped]] and new versions of the interpreter can be developed in the language itself. It was in this way that [[Donald Knuth]] developed the TANGLE interpreter for the language [[WEB]] of the de-facto standard [[TeX]] [[typesetting|typesetting system]]. Defining a computer language is usually done in relation to an abstract machine (so-called [[operational semantics]]) or as a mathematical function ([[denotational semantics]]). A language may also be defined by an interpreter in which the semantics of the host language is given. The definition of a language by a self-interpreter is not well-founded (it cannot define a language), but a self-interpreter tells a reader about the expressiveness and elegance of a language. It also enables the interpreter to interpret its source code, the first step towards reflective interpreting. An important design dimension in the implementation of a self-interpreter is whether a feature of the interpreted language is implemented with the same feature in the interpreter's host language. An example is whether a [[closure (computer science)|closure]] in a [[Lisp programming language|Lisp]]-like language is implemented using closures in the interpreter language or implemented "manually" with a data structure explicitly storing the environment. The more features implemented by the same feature in the host language, the less control the programmer of the interpreter has; for example, a different behavior for dealing with number overflows cannot be realized if the arithmetic operations are delegated to corresponding operations in the host language. Some languages such as [[Lisp programming language|Lisp]] and [[Prolog]] have elegant self-interpreters.<ref>Bondorf, Anders. "[https://web.archive.org/web/20181112101324/https://pdfs.semanticscholar.org/a089/c5ae66c3311b45de0aaddfa457e4eb821316.pdf Logimix: A self-applicable partial evaluator for Prolog]." Logic Program Synthesis and Transformation. Springer, London, 1993. 214-227.</ref> Much research on self-interpreters (particularly reflective interpreters) has been conducted in the [[Scheme (programming language)|Scheme programming language]], a dialect of Lisp. In general, however, any [[Turing completeness|Turing-complete]] language allows writing of its own interpreter. Lisp is such a language, because Lisp programs are lists of symbols and other lists. XSLT is such a language, because XSLT programs are written in XML. A sub-domain of [[metaprogramming]] is the writing of [[domain-specific language]]s (DSLs). Clive Gifford introduced<ref>{{cite web |last1=Gifford |first1=Clive |title=Eigenratios of Self-Interpreters |url=http://eigenratios.blogspot.com/2006/11/wanted-eigenratios-of-brainfck-self.html |website=Blogger |access-date=10 November 2019}}</ref> a measure quality of self-interpreter (the eigenratio), the limit of the ratio between computer time spent running a stack of ''N'' self-interpreters and time spent to run a stack of {{nowrap|''N'' β 1}} self-interpreters as ''N'' goes to infinity. This value does not depend on the program being run. The book ''[[Structure and Interpretation of Computer Programs]]'' presents examples of [[meta-circular evaluator|meta-circular interpretation]] for Scheme and its dialects. Other examples of languages with a self-interpreter are [[Forth (programming language)|Forth]] and [[Pascal (programming language)|Pascal]].
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Interpreter (computing)
(section)
Add topic