Forth Books

Become Proficient in Forth with Free Books

Forth Books

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.

Thinking Forth

Thinking Forth

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.

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).

Forth

Forth

By Wikibooks (HTML)

Chapters cover:

  • Introduction
  • Core ideas of Forth
  • Parsing in Forth, or “What happened to the Compiler”
  • Structuring vs. words that actually do something
  • Basic Syntax
  • Manipulating the Stack
  • Arithmetics
  • Control Structures
  • Handling Files
And So Forth

And So Forth…

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.

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.

NOTE: The following books are free-to-read but are not released under an open source license.

PROGRAMMING LANGUAGE PROFILES

Ada, Assembly, C, C++, C#, Clojure, CoffeeScript, ECMAScript, Erlang, Forth, Go, Haskell, HTML, Java, JavaScript, Lisp, Logo, Lua, OCaml, Pascal, Perl, PHP, Python, R, Ruby, Rust, Scala, Scratch, Swift, VimL

Leave a Reply