Thu Oct 4 00:34:01 CEST 2007

Is PF really forth?

So, what is forth, really?

Forth is more like a design pattern, than a real language. Hence we
say 'a Forth' instead of just 'Forth'. I think the easiest way to
describe Forth is by means of how it works. Basically, a forth is an

Interpreter means here, very practically, a translater of some
language to machine code. Deep down, a Forth consists of very small
chuncks of machine code. In PacketForth, thise chunks are actually C
code, so the lowest layer is abstracted away from the programmer. In
BadNop, the lowest layer is C for the host, and machine code for the

A basic Forth contains 2 interpreters. This means there are at least 3
language levels, or 3 representation levels for code.

M. machine code
X. execution tokens
A. ascii source code

PacketForth contains 4 levels, and 3 interpreters to move between the levels.

M. compiled C code
X. execution tokens
S. symbols
A. ascii source code

The presence of the S. level enables to implement lisp-style symbolic
macros along side forth-stile compile time executing macros (create

The power of a language could be somehow measured by the amount of
reflection possible. In PacketForth, the 3 interpreters enable you to
move to a lower level, while it is possible to move to a higher level
by generating either X S or A code.