The Best Programming Language for the End of the World


Coding in Forth reminded me of the lawless dystopia in Mad Max. You make your own rules, subject to the limits of the context. You can redefine the IF statement if you so please. You can rewrite machine code instructions for a Word. You can even change Words during run time. Because Words become keywords themselves in Forth, you can create a language that’s optimized for a single purpose, packing commands that would otherwise be dozens of lines into just one. “In Forth, you’re creating your own language,” Leo Brodie, author of the first Forth textbook, Starting Forth, told me.

The low-level nature of Forth, while key to its processing power, made programming feel foreign. It uses postfix, a form of mathematical notation that renders 2 + 1 as 2 1+ and which I found neither intuitive nor even really legible. And while most languages allow memory to be broken up and moved around, Forth is stack-based—meaning data is stored chronologically and managed on a last-in/first-out basis. I kept running into bugs, forcing myself to abandon programming conventions I had considered universal. I found myself struggling to speak the language of the machine.

When I emailed Dupras to ask for help, he compared using Forth to driving a stick. It’s more granular than C. Where the latter defines calling conventions, variable storage, and return stack management, Forth leaves it all up to the programmer. It directly interacts with memory the same way C does but far outperforms C in precision and efficiency. “People mistake Forth as just a language,” Dupras says. “It’s a way to interact with the computer.”

The reason Forth isn’t more popular is the same reason most of us drive automatics. The personal computing boom of the 1990s sparked an obsession with making tech fit your palm and making code easier to write. Languages were abstracted to protect programmers from themselves, and somewhere along the way, we got lost. Things became bloated for the sake of convenience and, in Dupras’ words, started “oozing inscrutable pus at every corner.”

“The way we understand efficiency is so skewed,” Dupras says. Forth is a scythe to Python’s lawnmower. “If you calculate the number of joules per blade of grass, you’ll find that the person scything is more efficient,” he says. “When you think of speed, you’d see the lawnmower as more efficient.” Forth forces you to be precise and memory-efficient—to marshal your resources carefully, as you would after the collapse. Dupras cuts his own lawn with a scythe, obviously. “At a certain point, you can go as fast as a lawnmower,” he says.

I began to find my way. Rather than sending bytes into the ether and trusting the system to figure out where they go, as I would in Python, I got used to being responsible for allocating and freeing memory. All I could think about was what was being stored, where it was being stored, and how much space it required. Each line of code suddenly bore weight. I was Immortan Joe, my laptop was my Citadel, and memory was my water.

Soon I found myself refining and revisiting my code like I would a run-on sentence. Instead of expecting the machine to anticipate my needs, I tried to think like the machine, to meet it more than halfway. And because I had to think twice, all the needlessly complicated acronyms that remind us to be concise in other coding languages—YAGNI (you aren’t gonna need it), KISS (keep it simple, stupid), DRY (don’t repeat yourself)—were rendered obsolete.


Leave a Reply

Your email address will not be published. Required fields are marked *