Reva: Comparison with ANS Forth

There are a lot of differences between Reva and ANS Forth.

For starters, Reva doesn't even try to be compatible with ANS. "But...", I hear you say, "ANS is the standard! Surely adhering to the standard is good!". Well, if the standard were good, and if ANS-compatible Forths all looked the same, you would have a point. There's an ironic statement, "Once you've seen one Forth, you've seen one Forth". I'm afraid that is mostly true.

In order to make life easier for ANS-ifiles, there is actually an ANS compatibility layer to Reva. Happily for most of us, it is not loaded by default. If you with to use the ANS layer (such as it is), do:

needs ansi

within Reva, or launch Reva with a command-line parameter of '-a':

reva -a

Now when you type words you will see some ANS compatible things. Be warned: the ANS layer currently breaks many "normal" Reva libraries, since it redefines the word repeat in a most incompatible manner. I hope to have this fixed sometime soon, but it is very low priority to me.

Reva has some words which are similar to ANS words yet not the same:

While for this specific task ANS looks easier to program, there are a lot of implementation details that make the way Reva uses easier to implement and if extended by special words even more interesting - e.g. with some extensions of HelFORTH (it's no big exercise to have this in Reva) the example would look like this:

  :: v: emit '* v: emit ; is emit

("v:" means to compile the current target of a deferred word or as in HelFORTH terms: compile the current target of a "doer").