Falvotech.
Conquering the world is easy — what do you do with it afterwards?

L I N K S


⇐ Unsuitable GOS Expanded to 256KiB

⇒ Blood Falls


On Forth Patterns and Practices
Samuel A. Falvo II
kc5tja -at- arrl.net
2010 Feb 27 23:47 PDT

For several years that I can recall, I threatened the world with a series of articles on Forth design patterns, programming practices, and the like. I find it sorely needed, for you often hear even Chuck Moore ask questions along the lines of, "How do you communicate good Forth programming technique? What is that magic?" Just as Gamma, Helm, Johnson, and Vlissides advanced the state of object-oriented software comprehension with their publication of Design Patterns, I feel that observing, documenting, and collecting patterns relevant to Forth can prove similarly useful to those wishing to learn the language, either for profit or for fun. It matters not to me that Forth fails the wave-of-the-future test; the lessons learned dealing with Forth often apply to other languages as well, including but not limited to C, Factor, and Haskell, even if the precise application of the patterns require language-specific tweaks.

Today, I gave an hour-and-fifteen-minute-long presentation on a collection of patterns observed while programming my optical networking project's HDLC implementation. A link to the slide deck used eventually will appear on the SVFIG website somewhere. Still, so much detail exists that I couldn't cover things as in-depth as I would have liked. I could have spent at least 30 minutes talking about any one of them. I want, eventually, to write up a blog article for each of the following patterns I discussed today:

  • Declarative, Imperative, then Inquisitive
  • Aggressive Handling
  • Partial Continuation
  • Ascetic Programming
  • Factor Indices
  • Demultiplex by Request

As work progresses on the HDLC project, as Unsuitable continues undergoing maintenance, and as new project ideas come to fruition through the use of Forth, I hope further patterns evolve to a point suitable for documenting here. If I can generate enough material, and/or if I receive reader submissions about their own patterns they've uncovered, maybe I can bundle the articles into a convenient paperback book form, purchasable at reasonable cost through a publish-on-demand provider, such as lulu.com or its competitors.