Forth is an imperative stack-based programming language, and a member of the class of extensible interactive languages. It was created by Charles Moore in 1970 to control telescopes in observatories using small computers. Because of its roots, Forth stresses efficiency, compactness, flexible and efficient hardware/software interaction.
Forth has a number of properties that contrast it from many other programming languages. In particular, Forth has no inherent keywords and is extensible. It is both a low level and high level language. It has the interesting property of being able to compile itself into a new compiler, debug itself and to experiment in real time as the system is built. Forth is an extremely flexible language, with high portability, compact source and object code, and a language that is easy to learn, program and debug. It has an incremental compiler, an interpreter and a very fast edit-compile-test cycle. Forth uses a stack to pass data between words, and it uses the raw memory for more permanent storage. It also lets coders write their own control structures.
Forth has often being deployed in embedded systems due to the compactness of object code. Forth is also used in boot loaders such as Open Firmware (developed by Sun Microsystems) as well as scientific fields such as astronomy, mathematics, oceanography and electrical engineering.
We publish a series covering the best open source programming books for other popular languages. Read them here.
By Leo Brodie (313 pages)
Thinking Forth captures the philosophy of problem solving and programming style, applied to the unique programming language Forth. The book was first published in 1984. It is widely recognised as an essential read for all budding Forth programmers.
Many software engineering principles discussed here have been rediscovered in eXtreme Programming, including (re)factoring, modularity, bottom-up and incremental design. Learn all about the philosophy of Forth, analysis, decomposition, problem solving, style and conventions, factoring, handling data, and minimizing control structures.
The book includes interviews with the investor of Forth, Charles H. Moore, as well as interviews with other Forth luminaries.
Thinking Forth is published under a Creative Commons license (attribute, non-commercial, share-alike).
By Wikibooks (HTML)
By J.L. Bezemer (82 pages)
This primer was written in the hope that it’ll be useful and that starting Forth developers aren’t discouraged by the cost of Forth textbooks.
Permission is granted to copy, distribute and/or modify this book under the terms of the GNU Free Documentation License, Version 1.1 or any later version.
NOTE: The following books are free-to-read but are not released under an open source license.
- Starting Forth – written by Leo Brodie, the author of Thinking Forth.
- Programming Forth – introduces the reader to Forth systems.
- Stack Computers: the new wave – a useful reference work on Forth-style stack computers.
- Realtime Forth – published under a shareware license.