Often, Forth implementations have a simple virtual machine at heart, consisting of three primitives. Those are:
- nest, also called docol
- unnest, or semi_s (;s)
- next
- ip (instruction pointer)
- w (word pointer)
- rp (return stack pointer)
- sp (parameter stack pointer for passing parameters between words)
next: (ip)+ -> w ; jmp (w)+ nest: ip -> -(rp) ; w -> ip ; next unnest: (rp)+ -> ip ; nextother models are:
- DTC (Direct Threaded Code)
- STC (Subroutine Threaded Code)
- TTC (Token Threaded Code)
- return threading
- string threading
- call threading