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!
Were the ports in FORTH also or were they completely rewritten?
Seems to me like the paragraph right before Discussion effectively says those were in FORTH too, and that was the reason for the quick ports.
IBOL is/was a brilliant move and made the logic so visual. I often wondered what ChipWits might have looked like if programmed in mTropolis, a much loved multimedia app that Quark quashed.
My brother Don was the father of MacFORTH, and I had the privilege of working with him at Creative Solutions lo these many years ago…
Like Doug said above, the barrier to entry to writing code for the Mac early on was pretty onerous both in terms of required hardware and plowing through the API “phonebooks”. We created MacFORTH to enable what we liked to call “Programming for the Rest of Us”, and we took great joy watching MacFORTH developers creating some amazing products. Chipwits was a favorite — a pioneer in it’s time teaching the art of programming visually. Don and I spent many a late evening chasing pie and coffee and each offering “constructive criticism” to the other regarding their respective IBOL code.
I was thrilled when I heard that ChipWits was making a return tour, and I look forward chasing pie and coffee in memory of my dear brother Don.
Obviously ChipWits is a game/sim first, but the logical thinking it instills reaches beyond the little bot. It might be helpful to have a place on this site linking for “next steps” in learning coding.
In 1990, I got a job at the Center for Astrophysics and Space Sciences in the Physics Department at UCSD as a student programmer. I was an undergraduate working with tenured professors, postdocs, and PhD candidates. I worked on the Electron Drift Instrument, which was many years later launched aboard the Shuttle. I was roughly the 30th candidate interviewed. I got the job on the spot, because I was not only the only one to have even heard of Forth out of the 30, I had actually taken a course on Forth programming. I had been interested in Forth for many years by this point. To this day, it is the coolest job I have had.
I used LMI/32 Forth to maintain the entire test harness, which included a stepper motor to position the device, an electron gun, a channel plate (the same tech in night vision devices) to record data, sophisticated data analysis, and a GUI to run it all. I did a lot of bare metal coding to get it to work. I inherited 25 screens written by my boss, that did some very rudimentary and primitive stuff, and that ballooned to 250 by the time I left a year later, written by me. I still have the code today.
The hardware was a 386 with a 387 (which we used extensively) and a then-enormous 8MB RAM (1MB was the base level at this time, and 4MB was a serious amount).
That is such a great picture of you and Dad!
One of the most creative and fun times of my life.
A percentage of ChipWits profits will go to the Osteogenesis Imperfecta Foundation.
Did you ever see this article about ChipWits?
I remember talking to Don a lot! I should have mentioned how cool it was to work with Creative Solutions. Always responsive, even to my FORTH noob questions.
So glad to hear that you guys are ChipWits fans. I know you’ll like its current incarnation.
Stay in touch!
I was in the audience at 3M as a member of the 3M Personal Compurter Club when Doug made a presentation that featured Chipwits. That presentation led to a contest to achieve the highest score in Octopus Gardens. The contest was very addictive resulted in several distinctive approaches to the problem. (I still have my copy of the game.)
Oddly, I may be turning to FORTH as a solution to a problem that I have encountered at my new workplace.
I remember that well! Our first meeting with a bunch of CW fans.
One of you found a simple “solution” to one of the missions (I forget which one)–standing on a DOOR and spin around zapping. The baddies would respawn in each room and you could rack up a score much higher that hunting the baddies down.
Please sign up for our mailing list to be a playtester in our 2nd round of testing.
You must have googled “ChipWits” to find us.