Why was the FORTH Programming Language used to create ChipWits?
Long, long ago in an ancient era (1984) when microcomputers were a new thing, Mike Johnston and I fell in love with the Macintosh and bought one (for $4,700!) on which to create ChipWits.
We immediately ran into a big problem—we didn’t have enough money to code the game. Developers couldn’t program directly on the Mac because there were no programming languages ready to use. Apple insisted that developers buy an expensive Apple Lisa computer to write Mac software on. A Lisa cost $9,995! That’s over $27,000 in 2023 dollars. No way!
Luckily a solution appeared. A company called Creative Solutions, Inc, came out with a Mac coding language called MacFORTH. It was based on a weird little programming language called FORTH.
Luckily I had been programming in FORTH since ’82. FORTH was not a popular language, but it was often the first programming language that appeared on a new microcomputer. In the 80’s there were a bunch of micros: Apple II, Commodore 64, Atari ST, Radio Shack TRS-80, IBM PC Jr., to name a few. FORTH was one of the first languages to appear on each. Because FORTH is a simple and very small language, it was the easiest language to implement for new computers.
FORTH was a blessing and a curse. A blessing because we could write ChipWits on the Mac. A curse because FORTH is a very strange, terse, hard-to-read language.
Here is the FORTH code to add 7 to 1 and print the result:
7 1 + .
Here’s what it does:
- 7 [Put 7 on the stack (you’ll learn about stacks while playing ChipWits.)]
- 1 [Put 1 on the stack.]
- + [Add the top two numbers on the stack, remove both from the stack, and put the answer (8!) on the top of the stack]
- . [Print the top number on the stack]
FORTH has been called a Write-Only-Language because it’s hard to understand what you wrote when you return to the code after even a few days.
I’m glad we developed IBOL rather than making ChipWits players learn FORTH.
I dug into MacFORTH and the complex, mysterious workings of the new Macintosh, and wrote the game.
We got ChipWits out the door in time for the ’84 Christmas sales. Then it was time to port the game to the Commodore 64 and the Apple II. The Mac had 128k of memory and the C64 had 64k. Most people who owned Apple IIs had only 64k of RAM. I had to shrink the program by half.
I had to do extreme things like shortening the variable and function names because they took up RAM.
The strategy of using FORTH paid off. We coded the C64 and Apple II versions in a few months.
I wish I could have programmed the game using IBOL instead of FORTH. 🙂
Are there any other FORTH programmers out there? Share your stories about FORTH or MacFORTH in the comments below!
Thanks for playing ChipWits! Spread the word!