Free Programming Books

7 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
JavaGeneral-purpose, concurrent, class-based, object-oriented, high-level language
CGeneral-purpose, procedural, portable, high-level language
PythonGeneral-purpose, structured, powerful language
C++General-purpose, portable, free-form, multi-paradigm language
C#Combines the power and flexibility of C++ with the simplicity of Visual Basic
JavaScriptInterpreted, prototype-based, scripting language
PHPPHP has been at the helm of the web for many years
HTMLHyperText Markup Language
SQLAccess and manipulate data held in a relational database management system
RubyGeneral purpose, scripting, structured, flexible, fully object-oriented language
AssemblyAs close to writing machine code without writing in pure hexadecimal
SwiftPowerful and intuitive general-purpose programming language
GroovyPowerful, optionally typed and dynamic language
GoCompiled, statically typed programming language
PascalImperative and procedural language designed in the late 1960s
PerlHigh-level, general-purpose, interpreted, scripting, dynamic language
RDe facto standard among statisticians and data analysts
COBOLCommon Business-Oriented Language
ScalaModern, object-functional, multi-paradigm, Java-based language
FortranThe first high-level language, using the first compiler
ScratchVisual programming language designed for 8-16 year-old children
LuaDesigned as an embeddable scripting language
LogoDialect of Lisp that features interactivity, modularity, extensibility
RustIdeal for systems, embedded, and other performance critical code
LispUnique features - excellent to study programming constructs
AdaALGOL-like programming language, extended from Pascal and other languages
HaskellStandardized, general-purpose, polymorphically, statically typed language
SchemeA general-purpose, functional language descended from Lisp and Algol
PrologA general purpose, declarative, logic programming language
ForthImperative stack-based programming language
ClojureDialect of the Lisp programming language
JuliaHigh-level, high-performance language for technical computing
AwkVersatile language designed for pattern scanning and processing language
CoffeeScriptTranscompiles into JavaScript inspired by Ruby, Python and Haskell
BASICBeginner’s All-purpose Symbolic Instruction Code
ErlangGeneral-purpose, concurrent, declarative, functional language
VimLPowerful scripting language of the Vim editor
OCamlThe main implementation of the Caml language
ECMAScriptBest known as the language embedded in web browsers
BashShell and command language; popular both as a shell and a scripting language
LaTeXProfessional document preparation system and document markup language
TeXMarkup and programming language - create professional quality typeset text
ArduinoInexpensive, flexible, open source microcontroller platform
TypeScriptStrict syntactical superset of JavaScript adding optional static typing
ElixirRelatively new functional language running on the Erlang virtual machine
F#Uses functional, imperative, and object-oriented programming methods
TclDynamic language based on concepts of Lisp, C, and Unix shells
FactorDynamic stack-based programming language
EiffelObject-oriented language designed by Bertrand Meyer
AgdaDependently typed functional language based on intuitionistic Type Theory
IconWide variety of features for processing and presenting symbolic data
XMLRules for defining semantic tags describing structure ad meaning
ValaObject-oriented language, syntactically similar to C#
Standard MLGeneral-purpose functional language characterized as "Lisp with types"
DGeneral-purpose systems programming language with a C-like syntax
Share this article

Share your Thoughts

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