Forth (programming language): Difference between revisions

Content deleted Content added
ce
top: para reorg, bit more detail on timeline
Line 17:
Forth typically combines a compiler with an integrated command shell,{{efn|There are exceptions, such as Ulrich Hoffmann's preForth [http://www.euroforth.org/ef18/papers/hoffmann-slides.pdf][http://www.euroforth.org/ef18/papers/hoffmann.pdf] and Tom Zimmer's TCOM}} where the user interacts via [[subroutine]]s called ''words''. Words can be defined, tested, redefined, and debugged without recompiling or restarting the whole program. All syntactic elements, including variables, operators, and control flow, are defined as words. A [[stack (abstract data type)|stack]] is used to pass parameters between words, leading to a [[Reverse Polish notation]] style.
 
For much of Forth's existence, the standard technique was to compile to [[threaded code]], which can be interpreted faster than [[bytecode]]. One of the early benefits of Forth was size: an entire development environment—including compiler, editor, and user programs—could fit in memory on an 8-bit or similarly limited system. No longer constrained by space, there are modern implementations that generate [[Optimizing compiler|optimized]] [[machine code]] like other language compilers. The relative simplicity of creating a basic Forth system has led to many personal and proprietary variants, such as the custom Forth used to implement the bestselling 1986 video game ''[[Starflight]]'' from [[Electronic Arts]].<ref name="maher">{{cite web|last1=Maher|first1=Jimmy|title=Starflight|url=https://www.filfre.net/2014/10/starflight/|website=The Digital Antiquarian|date=October 28, 2014|access-date=April 29, 2023}}</ref>
 
The relative simplicity of creating a basic Forth system has led to many personal and proprietary variants, such as the custom Forth used to implement the bestselling 1986 video game ''[[Starflight]]'' from [[Electronic Arts]].<ref name="maher">{{cite web|last1=Maher|first1=Jimmy|title=Starflight|url=https://www.filfre.net/2014/10/starflight/|website=The Digital Antiquarian|date=October 28, 2014|access-date=April 29, 2023}}</ref> Forth is used in the [[Open Firmware]] [[boot loader]], in [[spaceflight]] applications<ref name="oSWRm">[https://web.archive.org/web/20101024223709/http://forth.gsfc.nasa.gov/ NASA applications of Forth] (original NASA server no longer running, copy from archive.org)</ref> such as the [[Philae (spacecraft)|''Philae'' spacecraft]],<ref name="zYmBe">{{cite web|title=Intersil's RTX processors and Forth software controlled the successful Philae landing|url=https://mpeforth.com/press/MPE_PR_From_Telescope_to_Comet_2014_11_13.pdf |access-date=April 29, 2023|website=MicroProcessor Engineering Limited|date=October 13, 2014}}</ref><ref name="sgEMh">{{cite web|title=Here comes Philae! Powered by an RTX2010|url=https://www.cpushack.com/2014/11/12/here-comes-philae-powered-by-an-rtx2010/|website=The CPU Shack Museum|date=October 12, 2014|access-date=April 29, 2023}}</ref> and in other embedded systems which involve interaction with hardware.
 
Beginning in the early 1980s, Moore developed a series of microprocessors for executing compiled Forth-like code directly and experimented with smaller languages based on Forth concepts, including cmForth and [[colorForth]]. Most of these languages were designed to support Moore's own projects, such as chip design.
 
== Uses ==