Originally published on: Tue, 04 Aug 2009
I needed a little mental exercise tonight, so I chose to write a quine ( a program that produces its own source as its output ) in the Forth programming language?
Why Forth? Because I’m a novice Forth programmer at best. I don’t think very well in Forth, so this took some effort. Here’s the quine: ( the source for this quine is in the public domain )
Originally published in Commodore Hacking electronic magazine #15, April 1998
In the early 70’s, Charles Moore designed one of the most powerful computing languages known. This language, Forth, was very different from the traditional procedural languages.
Forth is a language which allows the programmer to change most any facet of the language they wish ( including syntax extensions ).
Forth’s rapid acceptance on 8-bit microcomputers stemmed from the fact that it took a relatively small amount of memory to properly implement the language.
This post was formerly hosted at a couple of my other blogs. I’ve moved it here. It was originally posted in 2000.
If you’ve ever used a Forth compiler, chances are you’ve heard the name Tom Zimmer. Tom’s been a staple in the Forth community for a few decades. Tom developed a number of Forth systems for popular 8-bit microcomputers that dominated the home-computer market in the 80’s.
Tom is the creator of the freeware Win32Forth system.
I built a non-Turing-complete interpreter in Go whose current incarnation is simply named “rpnrepl”. rpnrepl is a very tiny stack-based, postfix language whose syntax is similar to that of the Forth programming language.
rpnrepl can only perform four mathematical operations, display the topmost item on the stack, display a newline, and exit the running program.
Unlike Forth whose grammar can change dynamically, rpnrepl does have a simple grammar. Words are separated by spaces unless bound by single quotation-marks or double quotation-marks.
When I first began using microcomputers in the late 1970’s, development tools for 8-bit machines were precious and mysterious commodities. Most of these sorts of tools that looked to be useful were very expensive. My usage of most of these tools was driven by budgetary constraints.
The Gateway Drug : BASIC
All it really took to pique someone’s interest in microcomputers was to show them a simple program such as: