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
Compiler-compiler
(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!
===Forth metacompiler=== {{Tone|section|date=August 2015}} Many advocates of the language [[Forth (programming language)|Forth]] call the process of creating a new implementation of Forth a meta-compilation and that it constitutes a metacompiler. The Forth definition of metacompiler is: :"A metacompiler is a compiler which processes its own source code, resulting in an executable version of itself." This Forth use of the term metacompiler is disputed in mainstream computer science. See [[Forth (programming language)#Self-compilation and cross compilation|Forth (programming language)]] and [[History of compiler construction#Forth|History of compiler construction]]. The actual Forth process of compiling itself is a combination of a Forth being a [[History of compiler construction#Self-hosting compilers|self-hosting]] [[extensible programming]] language and sometimes [[History of compiler construction#Cross compilation|cross compilation]], long established terminology in computer science. Metacompilers are a general compiler writing system. Besides the Forth metacompiler concept being indistinguishable from self-hosting and extensible language. The actual process acts at a lower level defining a minimum subset of forth ''words'', that can be used to define additional forth words, A full Forth implementation can then be defined from the base set. This sounds like a bootstrap process. The problem is that almost every general purpose language compiler also fits the Forth metacompiler description. : When (self-hosting compiler) X processes its own source code, resulting in an executable version of itself, X is a metacompiler. Just replace X with any common language, C, C++, [[Java (programming language)|Java]], [[Pascal (programming language)|Pascal]], [[COBOL]], [[Fortran]], [[Ada (programming language)|Ada]], [[Modula-2]], etc. And X would be a metacompiler according to the Forth usage of metacompiler. A metacompiler operates at an abstraction level above the compiler it compiles. It only operates at the same (self-hosting compiler) level when compiling itself. One has to see the problem with this definition of metacompiler. It can be applied to most any language. However, on examining the concept of programming in Forth, adding new words to the dictionary, extending the language in this way is metaprogramming. It is this metaprogramming in Forth that makes it a metacompiler. Programming in Forth is adding new words to the language. Changing the language in this way is [[metaprogramming]]. Forth is a metacompiler, because Forth is a language specifically designed for metaprogramming. Programming in Forth is extending Forth adding words to the Forth vocabulary creates a new Forth [[Dialect (computing)|dialect]]. Forth is a specialized metacompiler for Forth language dialects.
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)