I chose one of the TI MSP430 chips to write the initial version. You can buy one of TI's LaunchPad boards - superficially similar to an Arduino - but it's a better choice for developing a Forth, initially, because it has:
- 16-bit architecture
- Ferromagnetic RAM - which is similar to Flash, but faster and easier to write, and won't wear out in a lifetime, even if you write to it a million times per second.
- Von Neumann architecture - so the processor can run code stored in RAM, as well as in the Ferro RAM (not that I ended up using that feature). The architecture allows a program to easily modify parts of its own code - or add new code. This is not easily possible with the Atmel chips used in the smaller Arduinos - a program can only modify its own Flash memory if it has a bootloader set to do that - and the default way Arduino chips are configured have the bootloader set so that the program code can't access it, except immediately following a reset.
I wrote the whole thing in Assembler. Forth is peculiar in that once you've written the fundamentals, it becomes possible to write other parts in Forth itself. You're still using the assembler, but with a good macro assembler you can use macros to write Forth words in a sort of pseudo-Forth.
I used Alfred Arnold's excellent AS - which is free and open source. It targets a huge number of different microprocessors, including the Atmel ones used in Arduinos, 8080 and Z80, 6502, and some PIC chips. It's much faster to use than TI's own bloated CCS, assembling my whole Forth source code in a fraction of a second.
I may port it to Arduino, or to the Raspberry Pi Pico (ARM) next. It's been an interesting journey.
Anyone else interested in Forth, or ever played with it and maybe hated it?