Programming Books

8 Excellent Free Books to Learn Forth

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.

1. Thinking Forth by Leo Brodie

Thinking ForthThinking 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 recognized 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.

Chapters cover:

  • The Philosophy of Forth – examines some of the major philosophies advanced by computer scientists over the years.
  • Analysis – examines the analysis and engineering stages of the programming cycle.
  • Preliminary Design/Decomposition – discusses two ways to decompose your Forth application: decomposition by component and decomposition by sequential complexity.
  • Detailed Design/Problem Solving – applies problem-solving techniques to the detailed design of a Forth application.
  • Implementation: Elements of Forth Style – delves into Forth coding convention including listing organization, screen layout, spacing and indentation, commenting, and choosing names.
  • Factoring – organizing code into useful fragments. The chapter discusses various “factoring-out” techniques, and the criteria for useful factoring.
  • Handling Data: Stacks and States – examines how Forth handles data.
  • Minimizing Control Structures – examines techniques for simplifying and eliminating control structures such as using structured exits, vectoring, and redesigning.
  • Forth’s Effect on Thinking.
  • Appendix A: Overview of Forth (For Newcomers) – the dictionary, data structures, the stack, and control structures.
  • Appendix B: Defining DOER/MAKE – helps the reader install DOER and MAKE and understand how they work.
  • Appendix C: Other Utilities Described in This Book – define some of the words referred to in this book that may not exist in your system.
  • Appendix D: Answers to “Further Thinking” Problems.
  • Summary of Style Conventions.

Thinking Forth is published under a Creative Commons license (attribute, non-commercial, share-alike).

Read the book

2. Starting Forth by Leo Brodie

Starting ForthStarting Forth is an introduction to the FORTH language and operating system for beginners and professionals.

This book explains how to write simple applications in FORTH. It includes all standard FORTH words that you need to write a high-level, single-task application. This word set is an extremely powerful one, including everything from simple math operators to compiler-controlling words.

Each chapter also has a review of terms and a set of exercise problems. Several “Handy Hints” have been included to reveal procedural tips or optional routines that are useful for learners but that don’t merit an explanation as to how or why they work.

Read the book

3. Programming Forth by Stephen Pelc

Programming ForthProgramming Forth introduces you to modern Forth systems. In 1994 the ANS Forth standard was released and unleashed a wave of creativity among Forth compiler writers. Because the ANS standard, unlike the previous informal Forth-83 standard, avoid specifying implementation details, implementers took full advantage.

This book concentrates on introducing people who already know some programming to ANS Forth systems.

Apart from the introduction of ANS Forth itself, Programming Forth includes examples of varying sizes, exercises, some advanced topics, how to take best advantage of Forth and project management. The material is derived from course material from MicroProcessor Engineering and teaching work at Teesside University by Bill Stoddart and Peter Knaggs, plus new material.

Read the book

4. And So Forth… by J.L. Bezemer

And So ForthAnd So Forth… is a primer written in the hope that it’ll be useful and that starting Forth developers aren’t discouraged by the cost of Forth textbooks.

Chapters examine:

  • Forth fundamentals – looks at how to manipulate the stack, declaring variables, using booleans, constructs and more.
  • Arrays and Strings – shows the reader how to use arrays and strings
  • Stacks and colon definitions – topics included using values, saving temporary values, stack manipulations, and altering the flow with the Return Stack.
  • Advanced topics – booleans and numbers, including your own definitions, conditional compilation, exceptions, lookup tables, What DOES> CREATE do?, fixed point calculation, recursion, and forward declarations.

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.

Read the book

Next page: Page 2 – A Beginner’s Guide to Forth and more books

Pages in this article:
Page 1 – Thinking Forth and more books
Page 2 – A Beginner’s Guide to Forth and more books

All books in this series:

Free Programming Books
AdaALGOL-like programming language, extended from Pascal and other languages
AgdaDependently typed functional language based on intuitionistic Type Theory
ArduinoInexpensive, flexible, open source microcontroller platform
AssemblyAs close to writing machine code without writing in pure hexadecimal
AwkVersatile language designed for pattern scanning and processing language
BashShell and command language; popular both as a shell and a scripting language
BASICBeginner’s All-purpose Symbolic Instruction Code
CGeneral-purpose, procedural, portable, high-level language
C++General-purpose, portable, free-form, multi-paradigm language
C#Combines the power and flexibility of C++ with the simplicity of Visual Basic
ClojureDialect of the Lisp programming language
ClojureScriptCompiler for Clojure that targets JavaScript
COBOLCommon Business-Oriented Language
CoffeeScriptTranscompiles into JavaScript inspired by Ruby, Python and Haskell
CoqDependently typed language similar to Agda, Idris, F* and others
CrystalGeneral-purpose, concurrent, multi-paradigm, object-oriented language
CSSCSS (Cascading Style Sheets) specifies a web page’s appearance
DGeneral-purpose systems programming language with a C-like syntax
DartClient-optimized language for fast apps on multiple platforms
DylanMulti-paradigm language supporting functional and object-oriented coding
ECMAScriptBest known as the language embedded in web browsers
EiffelObject-oriented language designed by Bertrand Meyer
ElixirRelatively new functional language running on the Erlang virtual machine
ErlangGeneral-purpose, concurrent, declarative, functional language
F#Uses functional, imperative, and object-oriented programming methods
FactorDynamic stack-based programming language
ForthImperative stack-based programming language
FortranThe first high-level language, using the first compiler
GoCompiled, statically typed programming language
GroovyPowerful, optionally typed and dynamic language
HaskellStandardized, general-purpose, polymorphically, statically typed language
HTMLHyperText Markup Language
IconWide variety of features for processing and presenting symbolic data
JArray programming language based primarily on APL
JavaGeneral-purpose, concurrent, class-based, object-oriented, high-level language
JavaScriptInterpreted, prototype-based, scripting language
JuliaHigh-level, high-performance language for technical computing
KotlinMore modern version of Java
LabVIEWDesigned to enable domain experts to build power systems quickly
LaTeXProfessional document preparation system and document markup language
LispUnique features - excellent to study programming constructs
LogoDialect of Lisp that features interactivity, modularity, extensibility
LuaDesigned as an embeddable scripting language
MarkdownPlain text formatting syntax designed to be easy-to-read and easy-to-write
Objective-CObject-oriented language that adds Smalltalk-style messaging to C
OCamlThe main implementation of the Caml language
PascalImperative and procedural language designed in the late 1960s
PerlHigh-level, general-purpose, interpreted, scripting, dynamic language
PHPPHP has been at the helm of the web for many years
PostScriptInterpreted, stack-based and Turing complete language
PrologA general purpose, declarative, logic programming language
PureScriptSmall strongly, statically typed language compiling to JavaScript
PythonGeneral-purpose, structured, powerful language
QMLHierarchical declarative language for user interface layout - JSON-like syntax
RDe facto standard among statisticians and data analysts
RacketGeneral-purpose, object-oriented, multi-paradigm, functional language
RakuMember of the Perl family of programming languages
RubyGeneral purpose, scripting, structured, flexible, fully object-oriented language
RustIdeal for systems, embedded, and other performance critical code
ScalaModern, object-functional, multi-paradigm, Java-based language
SchemeA general-purpose, functional language descended from Lisp and Algol
ScratchVisual programming language designed for 8-16 year-old children
SQLAccess and manipulate data held in a relational database management system
Standard MLGeneral-purpose functional language characterized as "Lisp with types"
SwiftPowerful and intuitive general-purpose programming language
TclDynamic language based on concepts of Lisp, C, and Unix shells
TeXMarkup and programming language - create professional quality typeset text
TypeScriptStrict syntactical superset of JavaScript adding optional static typing
ValaObject-oriented language, syntactically similar to C#
VHDLHardware description language used in electronic design automation
VimLPowerful scripting language of the Vim editor
XMLRules for defining semantic tags describing structure ad meaning
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments