$ whois forth
Forth
first released in 1970 · by Charles H. Moore
$ guessprog --inspect forth
- year
- 1970
- paradigm
- concatenative
- family
- forth
- memory
- stack based
- binding
- dynamic
- safety
- weak
FORTH(7)
- AUTHORS
- Charles H. Moore
- HISTORY
- Charles "Chuck" Moore developed Forth during the 1960s as a personal toolkit, and around 1970 used it at the US National Radio Astronomy Observatory to control radio telescopes. Forth is stack based and extensible: programs are built by defining new "words" in terms of existing ones, all in reverse Polish notation. It fits in a few kilobytes, which made it popular on early microcomputers and embedded hardware. Moore meant to call it "Fourth", for a fourth-generation language, but the IBM 1130 he used allowed only five-character file names.
- USAGE
- Forth is a niche language today, used in some embedded systems, bootloaders and hobbyist projects. Its best-known industrial use was Open Firmware, the boot firmware of Sun workstations and PowerPC Macs.
- SEE ALSO
- Forth on Wikipedia ↗
\ Words are defined with : and ended with ;
: square ( n -- n*n ) dup * ;
: sum-of-squares ( a b -- n ) square swap square + ;
3 4 sum-of-squares . \ prints 25
: countdown ( n -- )
begin dup . 1- dup 0= until drop ;
5 countdown \ prints 5 4 3 2 1