I recently found a Forth interpreter I wrote a few years ago for the FUZIX operating system, and then forgot about; I’ve polished it up and given it a proper release on Github.

Main fforth page

See the main fforth page for more information.

fforth’s got two real claims to fame: the first is that it’s written in portable C without giving up too much performance, and the second is that it’s a single C source file which is also a runnable shell script containing an awk script and Forth source.

The reason for the latter is that running the source file as a shell script will pull Forth word definitions out of specially formatted comments in the source, recompile them using a simplified Forth compiler subset in awk, and patch the source with the updated compiled versions. This means that I can avoid the traditional Forth bootstrap phase of having to hand-compile enough of the interpreter to interpret the rest, making the whole system significantly easier to use and robust.

Normally this kind of thing is only ever done as a stunt, but this time… well, okay, it’s still a stunt. But a useful one.

It’s BSD 2-clause licensed. Take a look!