Forth Interpretation

  Some parts of this page/site are currently incomplete & will be updated asap
  Other parts will change continually so use “Refresh” in your browser !!
  There is extensive use of “Tooltips” text to support learning which do not seem to render on a Smartphone. This site is best viewed via a computer’s HD monitor


Previous Page: figForth’s Compilers

What is the difference between Interpreting & Compiling?

What is Interpretation?

Knuth (1997, pp. 200-201) discusses interpretive routines (more commonly known as “interpreters”), saying “an interpretive routine is a computer program that performs the instructions of another program, where the other program is written in some machine-like language…” Knuth goes on to say that “a machine-like language is able to represent a complicated sequence of decisions and actions in a compact, efficient manner…”

Knuth comments that a good machine designer should “also define the virtual machine whose language is to be interpreted…” (Knuth, 1997, p. 201)

Generally, interpretation is needed to execute code within a particular context

Forth contains a number of interpreters and new interpreters can be added as required. These are divided into an Outer Interpreter (Keyboard (or Text) Interpreter) which is Forth’s “Shell” (Brookshear, 2005, p. 115), and a number of Inner Interpreters

Using Tokens during Interpretation

Tokens rather than text strings can be used during compilation or interpretation. A token acts as a symbol equivalent to a text string

The Inner Interpreters

Summary

The “Roll Your Own” Compiler

Next Page: figForth Multitasking


Updated: 16th February 2022 by David Husband
© 2021 David Husband, a.k.a. Baremetal Engineer Extraordinaire
All Rights Reserved – All Trademarks & Copyrights Acknowledged
All personal information is subject to the Data Protection Act 2018 & the UK GDPR
“ad auxilium aliis ad auxilium sibi”