Concatenative language/Left to right evaluation

The evaluation rule for a concatenative language is as simple as it gets: scan through a quotation left to right, pushing literals on the stack, and jumping into word definitions (which are themselves either primitives, or have quotations as definitions).

This makes single-stepping debuggers very easy to use. Unlike some languages such as C++ where every statement is a minefield of implicit function calls, and it is not always clear what order things are evaluated in, in a concatenative language, the debugger always just walks left to right.

Factor has a 'walker' tool (enter some code in the UI listener and press Control-w) based on this principle. The walker is implemented using Continuations and can even step backwards if the code in question has no side-effects.

This revision created on Sat, 3 Jan 2009 01:19:01 by slava