In my previous post, Thinking in Forth I said that Forth is a dead language. I did this to make two points. The first is that I don’t have to revive or advocate a dead language, hurray, because that’s boring. The second point is that even a dead language still has value, like Latin does. However, just because I consider it to be a dead language doesn’t mean that everyone else does too.
Forth is an excellent choice for education for many reasons:
- it’s small, maybe 25 required core words
- most of these words are one, two, or three letters long, so familiarity with English is less of a prerequisite for learning Forth
- it’s simple with no built-in abstractions – source code maps directly to assembly code (a Forth word is just a list of calls to previously defined words)
- a Forth program is just a linked list of Forth words
- it has little syntax to learn
- there is only one data type in basic Forth – integers (called ‘cells’)
- useful programs can be written early in the learning process
- it’s very ‘bootstrappable’ – one learns by concatenation, not starkly delineated ‘levels’ or ‘tiers’ (tears?)
- paradigms such as object-oriented and functional programming are consistent with Forth (and in fact many of them have often already been very well implemented and documented)
- concatenative programming is much more pure and natural
- See Concatenative Biology
- syntonic programming is easier to learn and use
- See Forth: A Syntonic Language
- Forth is useful for building models and simulations
- open and non-proprietary versions of Forth are freely available for a wide range of platforms.
There are several efforts at delivering basic, classic Forth to beginning programmers. One that I particularly like is 4E4th which runs on a tiny, inexpensive protoyping card.
The Raspberry Pi can easily run the bigger, more capable Gforth, and the Python-based Pygmy Forth.
Several commercial enterprises continue to promote Forth. Some can be found towards the end of the excellent and extensive Forth page on Wikipedia.
The creator of Forth, Chuck Moore, is a tireless, brilliant, and dynamic force. He has never stopped developing cutting edge technology and innovation based on Forth. For a look at some of his latest work, here’s a talk he gave in September 2013 on the ga144 chip. It has 144 cores, with energy measured in picoJoules per instruction and power in nanoWatts per core, and is of course programmed in Forth. That’s hardly dead technology.
Forth has been described as a ‘timeless’ language. It is so fundamental, so elementary, so non-doctrinal, and so general purpose, that it may live on forever, even if just as an idea. It’s very Platonically intellectual in this sense. Arguably, Forth provides the most primitive computational platform possible. It’s as machine-like as assembly language, yet not nearly as machine-specific. A stand-alone Forth routine is often smaller than the equivalent code in assembler! (For others who would make the same claim, remember that library calls are cheating). It can be suitable for teaching and practicing computational thinking. I have found it to be the perfect tool for tinkering with computation from first principles.
One caveat: Forth is a difficult mindset to forget or ‘un-learn’ — it can be a one-way door.
“If you are squeamish, don’t prod the beach rubble.”
– Sappho
So, while I do not aspire to revive Forth or advocate it generally, I may have been in error in describing it as dead. I come to praise Forth, not to bury it.