Forth (programming language): Difference between revisions

Content deleted Content added
One of the See Also links was external, so moved to ext links.
Merged the two separate citations for Starting Forth into one.
Line 53:
{{further|Reverse Polish notation}}
 
Forth emphasizes the use of small, simple functions called ''words''. Words for bigger tasks call upon many smaller words that each accomplish a distinct sub-task. A large Forth program is a hierarchy of words. These words, being distinct modules that communicate implicitly via a stack mechanism, can be prototyped, built and tested independently. The highest level of Forth code may resemble an English-language description of the application. Forth has been called a ''meta-application language'': a language that can be used to create [[Domain-specific language|problem-oriented languages]].<ref name="Kg9SE">{{cite webbook |last1last=Brodie |first1first=Leo |title=Starting Forth |edition=2nd |year=1987 |publisher=Prentice-Hall |isbn=978-0-13-843079-5 |url=https://www.forth.com/starting-forth/0-starting-forth/ |website=Forth dot com |publisher=Forth, Incindex. |access-date=July 14, 2020html}}</ref>
 
Forth relies on explicit use of a [[stack data structure|data stack]] and [[reverse Polish notation]] which is commonly used in calculators from [[Hewlett-Packard]]. In RPN, the operator is placed after its operands, as opposed to the more common [[infix notation]] where the operator is placed between its operands. Postfix notation makes the language easier to parse and extend; Forth's flexibility makes a static [[Backus-Naur form|BNF]] grammar inappropriate, and it does not have a monolithic compiler. Extending the compiler only requires writing a new word, instead of modifying a grammar and changing the underlying implementation.
Line 305:
* VFX Forth, optimizing native code Forth
* [https://littlemanstackmachine.org/firth.html Firth], an adaptation of Forth for the Little Man Stack Machine computer.
*
 
== See also ==
Line 315 ⟶ 314:
== References ==
{{reflist}}
 
===Works cited===
* {{cite book |last=Brodie |first=Leo |title=Starting Forth |edition=2nd |year=1987 |publisher=Prentice-Hall |isbn=978-0-13-843079-5 |url=https://www.forth.com/starting-forth/index.html}}
 
== External links ==