Skip to content

thinking forth

Christopher P. Brown edited this page Jan 25, 2022 · 2 revisions

Thinking Forth

:forth📖

A Language and Philosophy for Solving Problems

by Leo Brodie

read: 2021


It's about Forth but it's really about general program design.

Implicity

Forth has implicit calls and implicit data passing (thanks to the stack). This allows for very concise, terse programs that are also very flexible and maintainable: it is possible to redefine a constant as a function ("word" in forth) and not have to change any other code: calls are implicit. (See: apples.forth)

Ways to do decomposition

or, ways to handle complexity

  1. By components. Example: text field editor (overwrite, insert, delete) has a key stroke interpreter and a display refresh component. Control flow is a superficial element of program design. The Interface Component is an important part of this design phase and has two interfaces: control (how it is invoked; a non-issue in forth) and data (in forth, either the stack or pointers)
Clone this wiki locally