FORTH
Charles "Chuck" Moore worked at MIT, then at the Stanford Linear Accelerator Center. The computing landscape of the time frustrated him because FORTRAN and ALGOL monopolized attention, but these languages forced him to spend an inordinate amount of time between writing code, compiling it, and executing it. He was looking for something more direct, more immediate.
His solution took the form of a text interpreter that he wrote in ALGOL. The principle was that everything you gave it was either a number or a word representing a command. Gone were the separate phases of editing, compilation, and execution. Everything happened interactively, in real time. He invented special words like ":" to tell the system it needed to start compiling the following code, and ";" to tell it to return to normal interpretation mode. When the compiler encountered such a block, it stored this "word"—the equivalent of our current functions—in a dictionary for later reuse.
FORTH’s architecture relies on two stacks working together. The first stores temporary values and parameters, the second manages stack frames. This approach produces compact and fast code, but above all, code that is infinitely extensible. In 1970, Moore was working on a third-generation IBM computer that limited names to a maximum of five characters. He therefore named his language "FORTH," an allusion in English to a fourth generation of programming language.
The National Radio Astronomy Observatory in Arizona welcomed the first public version of FORTH in 1971. The system was used to collect and analyze data while controlling the radio telescope in real time. The astronomy community adopted this technology. Moore then created several versions: MiniFORTH for minicomputers, MicroFORTH for microcontrollers. Each variant adapted to the specific constraints of its environment.
FORTH uses postfix notation, also called reverse Polish notation. Operators come after their operands. The expression 1 2 + means that 1 and 2 are added. However, the operation is interactive: when the user types this expression, the interpreter first pushes 1 onto the stack, then 2, before executing "+" which retrieves these two values, adds them, and puts the result back on the stack.
FORTH’s real strength comes from its ability to grow. Programmers create new commands, "words," which become an integral part of the language. This extensibility adapts FORTH to the precise needs of each application. The language combines low-level calculations with a powerful mechanism for declaring functions. Once compiled, FORTH programs run almost as fast as hand-written assembly. With a compiler that optimizes aggressively, FORTH is highly efficient in numerical processing. For embedded systems, prototype hardware, or boot loaders, a minimal compiler kernel is all that’s needed. Once this kernel is available, you can build a complete FORTH compiler using nothing but FORTH.
FORTH’s minimalist philosophy is reflected in memory management. The language only offers storage of simple or double values, typically integers. To build an array, you must allocate a variable and increment an internal pointer in the dictionary to reserve more space. An array in FORTH is just a region of memory without any particular documentation. The language doesn’t offer a native heap either; programmers write their own memory management routines.
Concrete applications of FORTH are multiplying. Sun Microsystems integrates it into the OpenBoot firmware of its workstations. WearLogic has developed an electronic wallet based on an AVR microcontroller programmed in FORTH. AEMS (Advanced Energy Monitoring Systems) uses FORTH for its Yatesmeter, a sophisticated instrument that monitors pumps in real time. These successes show that FORTH remains relevant for embedded systems and hardware control.
Technological evolution has not diminished interest in FORTH. Its interactive approach and ability to build abstractions step by step make it a valuable educational tool. Projects like pbFORTH for LEGO Mindstorms robots reveal its potential for teaching programming. Its particular syntax and mental model, which differs from conventional languages, offer students another perspective on programming concepts.
The FORTH community is active. User groups still exist in several countries, conferences like euroFORTH are held regularly. Recent developments include GNU Gforth, a portable version that complies with standards, and VFX Forth, a modern optimizing compiler that speeds up FORTH programs by a factor of three to five compared to traditional compilers.
Rather than imposing an abstraction between man and machine, FORTH creates a direct link to the hardware while allowing the construction of useful abstractions.