Forth 1970
Two stacks, a dictionary, and nothing else - build the language up word by word.
Influenced by: algol burroughs b5500 lisp
Forth is a tiny, stack-oriented, concatenative language and interactive environment created by Chuck Moore: code is a stream of words in Reverse Polish Notation that push and pop a shared data stack, and you grow the language itself by defining new words in a dictionary. There is no garbage collector and no type system - memory is fully manual and exposed. You carve out static data space with CREATE, ALLOT, and , (comma), fetch and store raw cells through @ and !, and on standard systems request and release heap blocks with the optional ALLOCATE/FREE/RESIZE word set. The whole compiler, editor, and runtime classically fit in a few kilobytes.
What makes it distinctive
- No garbage collector and no type system at all: cells are untyped machine words, and you manage every byte yourself - the language gives you the mechanism and trusts you with the policy.
- Manual static memory via the dictionary:
CREATE/VARIABLEcarve names into contiguous data space,ALLOTreserves bytes,,(comma) appends a cell, andHEREis the bump pointer to the next free address - allocation is literally moving a pointer forward. - Raw, direct memory access:
@(fetch) and!(store), plusC@/C!and+!, read and write any address with no bounds checks and no abstraction over the hardware. - Optional heap word set (
ALLOCATE,FREE,RESIZE) provides C-stylemalloc/free/reallocfor dynamic memory - but it is opt-in, GC-free, and you pair everyALLOCATEwith a matchingFREEby hand. - Two explicit stacks: a parameter (data) stack for Reverse Polish operands and a return stack you can manipulate directly (
>R,R>), giving you control over the call machinery itself. - Concatenative and self-extending: programs are just sequences of words;
:defines new words from old ones, andIMMEDIATE/CREATE...DOES>let you extend the compiler so you build the language up rather than down. - Extreme smallness: a complete Forth - interpreter, compiler, editor, and your application - has historically fit in a few kilobytes, making it a perennial choice for boot firmware and tiny embedded targets.
History
Forth grew out of a personal programming system that Charles H. "Chuck" Moore had been refining since the late 1950s. The language acquired the name FORTH in 1968 at Mohasco Industries, where Moore implemented it on an IBM 1130 minicomputer; he wanted to call it "Fourth" (a fourth-generation language) but the operating system limited file names to five characters, so it became FORTH. Moore wrote the first paper describing the language in 1970 - the date conventionally cited as the language's appearance.
Forth's design borrowed the twin-stack discipline of the Burroughs B5500 - Moore credited the stack words DUP, DROP, and SWAP to that machine's DUPL, DLET, and EXCH instructions - and reflected the minimalist, define-your-own-primitives ethos he admired in Lisp and ALGOL. In 1971 Moore joined the U.S. National Radio Astronomy Observatory (NRAO) and built the first complete, standalone Forth to control the new 36-foot (11-meter) radio telescope at Kitt Peak, demonstrating real multitasking instrument control on small hardware. In 1973 Moore and Elizabeth Rather, his first colleague to adopt the language, co-founded FORTH, Inc. to port and commercialize Forth systems across dozens of platforms.
Because anyone could (and did) implement Forth, dialects proliferated, prompting standardization. A 1977 Utrecht meeting produced the preliminary FORTH-77; the influential FORTH-79 followed from meetings on Catalina Island, and FORTH-83 revised it - controversially, since it flipped the canonical "true" flag from 1 to -1 and redefined NOT as a bitwise complement, breaking existing code. To heal the fragmentation, a committee formed in 1987 produced ANS Forth (ANSI X3.215-1994), adopted internationally as ISO/IEC 15145 in 1997. The community-run Forth 200x committee (formed 2004) then maintained the standard, releasing Forth 2012, ratified on 10 November 2014, which remains the current document at forth-standard.org.
Moore himself moved on from software to silicon, designing stack-machine CPUs (Novix, the MuP21 and GA144 chips) and the unconventional colorForth, pursuing the same radical minimalism in hardware. Forth endures in embedded systems, firmware, and bootloaders - most famously as the basis of Open Firmware used on Sun, Apple, and OLPC machines - while Gforth, the GNU implementation, keeps a standards-conforming Forth alive on modern systems.