What implementation of Forth should I use for learning Forth?

Some time ago I evaluated 4tH, an implementation of Forth. I think it meets all of your requirements. For instance the compiler is only 61 KB. There is also full support for floating point numbers, important if you want to try to use it for technical/scientific purposes.

4tH runs on most operating systems, including MS-DOS, MS-Windows (both 16 bit and 32 bit), Linux, Coherent, AIX, SunOS, BOS, BSD, Mac OS X, BeOS, RISC OS, etc. Download (Windows installer, 1.5 MB, includes the manual). Manual (PDF, 1.1 MB).

There is an active community centered around the Google Group 4tH-compiler. For instance today I received two messages.

Please note that in 4tH you can't define your own defining words (words executing at compile time). This is not a serious limitation, unless you want to cover advanced Forth features.


To get you started (as this is not very clear from the manual or the interactive compile), after installation copy the compiler, 4th.exe, to an empty folder, make two files in this directory, HelloWorld.bat and HelloWorld.4th, and run HelloWorld.bat:

HelloWorld.bat:

    4th.exe cx HelloWorld.4th
    pause

HelloWorld.4th:

   : hello ." Hello from XYZ!" cr cr ;
   hello

Win32Forth is really fantastic, as mentioned above. It has a nice integrated development environment and is a pretty modern implementation that seems to match up very well with the standards as well as including some more experimental but widely-accepted features.

I use Gforth, but I also use Vim to edit source files. :) Gforth is good and "classic" as far as the features it supports. It gives you a very "old school" Forth experience without being overly quirky to use. (Some free Forths do odd things with their command lines and such - I use Brodie's "Starting Forth" as the model of how a Forth interpreter should behave.)

I looked at SwiftForth, which is a very nice "high tech" Forth system that goes well beyond what the classic Forths offer in terms of language features and really brings Forth into the modern programming world. If you want to actually do Forth programs professionally, SwiftForth looks like it can handle just about anything you want to do with it.

Tags:

Ide

Forth