Forth: Why Isn't It Popular Today?
If I like Forth so much, why don’t I use it as a daily driver and why isn’t it more popular?
Well, old languages in general often have some really rough edges for modern users. And those old languages have now crossed some sort of Lindy effect (wikipedia.org) barrier and are effectively immortal…and preserved like a fly in amber and unable to evolve and improve.
(This is both wonderful - you can learn tools like find
or vi
and
expect them to work exactly the same way a decade from now - and horrible -
those crazy old tools will still work exactly the same way a decade from
now.)
In the case of Forth, in particular, the postfix notation alone is enough to make most people run screaming away from it. And I don’t blame them at all.
But even once you make it over the syntax barrier, Forth presents such a departure from what people are used to: the standard library is a dictionary of words, which is a wonderful concept. But learning how to "make a sentence" with those words is one of those easy to learn, difficult to master things like Chess or Go.
Simple, not easy
Oh, and Forth has an even bigger barrier to entry than most languages because one of its greatest strengths is the ability to build it up from tiny machine language primitives - which very few people have any desire to do. It’s one of those weird things were "simple" and "easy" are almost completely opposed!
By analogy, an assembly language is very simple. Syntactically, it’s usually extremely rigid: one machine instruction followed by some number of operands. Perhaps some labels and macros. You can often learn the whole thing in an afternoon. But learning how to effectively program in assembly is not easy. It doesn’t guide you into useful patterns. It doesn’t abstract away the mundane details to let you concentrate on your actual problem.
Forth is really interesting to compare with the assembly analogy because it absolutely lets you abstract away your problems. If anything, its concatenative, point-free style lets you effortlessly create even cleaner and more elegant (dare I say, natural-language-like?) abstractions than most imperative languages.
But like assembly, Forth doesn’t guide you into useful patterns. You must invent them for yourself.
(In retrospect, I suppose this might have been the appeal of OOP: that it provided a ton of guidance about how to structure your software. I say "in retrospect" because I started my career at the peak of Object-Oriented Programming’s hype with Java’s marketing in full swing and it was just about impossible for my little brain to understand a world outside of the all-consuming OOP in the sense of the goldfish saying, "what is water?")