6.14 Interpretation and Compilation Semantics

In Gforth every named word has interpretation and compilation semantics, i.e., separate actions that are performed in various contexts.

In principle these semantics can be anything and completely independent of each other, but in practice they are usually connected, and words usually have default compilation semantics (compile the interpretation semantics) or immediate compilation semantics (perform the interpretation semantics); a few have other combinations of interpretation and compilation semantics (combined words).

The standard also discusses execution semantics, but it uses them only to define interpretation and/or compilation semantics, so they are not as essential as interpretation and compilation semantics. In particular, for every word in the standard that has both interpretation and execution semantics, they are the same. In Gforth (since 1.0), they are always the same, and this manual uses the terms interchangeably, usually preferring interpretation semantics. In the description of defining words, you see “name execution”, which describes the interpretation/execution semantics of name.

Some named words also have some of to/+to/action-of/is/addr name semantics, but these are mostly discussed elsewhere (see Values, see Deferred Words, see Words with user-defined to etc.)