NetfreeProgramming

 

FORTH is a magical programming language, my favorite in many ways even though I hardly use it any more. FORTH is tiny yet huge, feeble yet powerful, hyper-efficient yet woefully wasteful. A functional FORTH system can fit into a few thousand bytes of computer memory and be totally understood by a single person after a few hours of study. What other language comes close to that crystalline perfection?

The foundation of FORTH is infinite extensibility. The language works, at an atomic level, simply by defining new "words" in terms of older ones. And so it grows, from a tiny seed into whatever structure the programmer directs it to become. FORTH is utterly malleable, a perfect clay in its sculptor's hands.

Marvelous enough. But like a small bird fascinated by a snake's gaze, what really fascinates me about FORTH (in its original and purest form) is its utter lack of a safety net. FORTH resembles a machine shop with no protective shields around the equipment. One slip, and you can cut yourself in two. But if you work with care and know your tools, your productivity is awesome.

In a classic FORTH implementation you can literally, with two keystrokes, crash your entire computer. (Sure, you could protect yourself against that, but no real FORTH programmer would deign to do so — that would slow down the execution speed of the software, and who wants that?)

The incantation for system suicide?

!

... a single exclamation mark, followed by an invisible <enter> that tells the machine to do it.

To explain: ! — pronounced "bang" — is the FORTH command to take the address on the top of the program's stack and store the second value from the stack into it. But if the stack isn't properly set up that single instruction will overwrite some area of memory, a critical area, and thereby trigger instant catastrophe (at least, in an operating system that doesn't have solid firewalls between program execution spaces).

So FORTH makes it trivial to say, "Bang! I'm dead!"

(see also CrystalsMudAndLife (19 Apr 1999), ScriptingLanguages (29 Jun 1999), SnipPattern (6 Sep 2001), TuringComplete (10 Oct 2001), PersonalComputerHistory (25 Feb 2002), PersonalProgrammingHistory (2 Apr 2002), MindChildren (17 Apr 2003), ... )


TopicProgramming - TopicHumor - TopicPersonalHistory - 2003-10-21


(correlates: ImpossibleStandards, SelfImprovement, NorthwestBranchMemories, ...)