Welcome to Forth

Welcome to Forth, a mid-level, interactive, word-based language (see below for a note about what "word-based" means.) In the language abstraction spectrum, Forth lies somewhere between assembler and system languages like C. Forth can be used as a "portable assembler", but it also supports the simple construction of arbitrary higher-level abstractions such as object-orientation. Forth's middle-of-the-road abstraction level and interactive nature addresses the following specific perceived shortcomings of other mainstream languages. Note that while there are many languages with one or more of Forth's features, Forth is unique in that it combines them all in one tool:

Notes

Some time ago I was involved in a discussion of Forth evangelism on comp.lang.forth. My position was that a lot of Forth propaganda seems to be of the "Drink the Kool-Aid" variety -- cult members preaching to the converted. In an attempt to develop a fair and unbiased description (to the extent such a thing is possible), I came up with the text above. It is my personal view of the Forth language and philosophy; if you don't like it, that's your prerogative. If you do like it, excellent :-)

What does "word-based" mean?

Forth is pretty much a context-free language. I consider a language "Forth-like" if, when looking at a program in that language, all you need to know to decide what to do next is, "what is the current token?" That's a very important property, because means the language is trivial to parse and nearly as trivial to interpret. C, for example, does not have that property: if you're interpreting (not that anyone does that) a C program, and you see a "(" token --- well, is it the beginning of an expression delimiter? Is it a function-call argument list delimiter? Is it a function definition argument-list delimiter? You just cannot know without examining the surrounding context, which may require a lot of lookahead or look-behind. In Forth, the current word tells you what to do, period. It may make use of some contextual data built by words previously executed, but there is no doubt whatsoever about exactly what code should execute when a word is encountered (leaving aside the infamous "state-smartness"). Another way to say this is that in Forth, there are no syntactic relationships between tokens; there are only behavioral relationships between executed words; and therefore there is no need for syntactic analysis, only behavioral analysis (aka "execution"). This, I think, is what is meant when it's said that Forth is a "word-based" language.