Felix Codes

Felix and Forth

I first discovered Forth on the ZX Spectrum. Couldn't tell you what dialect it was. Came with a game, a kind of mega-Lights Out, the only part of the system I was equipped to understand at the time. The name Forth stuck in my mind though.

Fifteen years later, I knew enough to make use of the fact that Forth is very easy to parse. So it became the basis of my first interpreter construction tutorial. That worked out great, but didn't help me use the language better. Reading Leo Brodie's classic Starting Forth and Thinking Forth books (free from forth.com) set me on the right track. It still wasn't enough. In the end, thanks to a friend, I got my hands on the seminal text Programming a Problem-oriented Language, by Charles Moore himself — the inventor of Forth.

Always seek to learn about a programming language from its inventor if you want to understand what it's all about.

The point of Forth isn't postfix notation. Some people find it more natural, but mostly that's for the computer's convenience, not the programmer's. The point of Forth isn't low-level access to hardware, either. That's just because the language once had to run on machines with 4K of RAM and no operating system. The point of Forth is making software open and transparent to its users, by providing a scripting engine with a minimum of effort. Indeed, in a language no more high-level than C++ it's possible to bootstrap a minimal working Forth in a couple of hours and a couple hundred lines of code, with little mental overhead. And when the programmer's work is made easier, they can do more to help users. Or as I wrote elsewhere recently:

How ironic. I spent years trying to figure out Forth, and when it happened, the big moment of enlightenment didn't involve reading postfix notation, or how create and does> work. Those are details.

Forth, you see, isn't some big established system you fetch from an official package repository and ritually embed in your application. It's something you weave into it little by little; not so much a library or component as a way of doing.

Also, a Forth can inspect and modify itself from within, under the user's control, making it uniquely flexible and future-proof.

My Forth systems

As of 2 December 2019, my latest creations are:

See also RPN-40, a programmable postfix calculator for mere mortals.

Other Forth systems

nasmjf Forth: a NASM port of JonesForth