You. Forth. Simplicity.

git repository
download
prior releases
documentation wiki
issue tracker
mailing list and forum
irc channel and logs
try it


This wiki remains, like the original forum, mainly for historical value. There is a new wiki which, while having less content, is more secure and oriented towards modern Retro implementations.

reload node | edit | recent changes | front page

Forth has one of the simplest syntaxes of any computer language. In fact, it might be said it has no syntax at all! What minimal syntax it has can be summed up as follows: Forth code is a bunch of words with spaces between them. This is even simpler than English! Each word is equivalent to a function or subroutine in a language like 'C'. Words are executed in the order they appear in the code. The following statement, for example, could appear in a Forth program:

WAKE.UP EAT.BREAKFAST WORK EAT.DINNER PLAY SLEEP

Notice that WAKE.UP has a dot between the WAKE and UP. The dot has no particular meaning to the Forth compiler. I simply used a dot to connect the two words together to make one word, and to make that word easier for a human to read. Forth word's names can use any combination of letters, numbers, or punctuation. We will encounter words with names like:

." #s swap ! @ dup . *

These are all called words. The word $-GL7OP is a legal Forth name, although not a very good one. It is up to the programmer to name words in a sensible manner. In general, Forth (and RetroForth in particular) give the programmer ultimate freedom to make whatever design decisions are appropriate, and does not get in the way of making bad decisions. Don't worry though: if you enter a word that RetroForth doesn't recognize (like $-GL7OP), Retro will respond with an error message.