Commit 541eddad authored by Peter Fidelman's avatar Peter Fidelman
Browse files

Define what "outer interpreter" means

parent 7fd742f0
......@@ -2069,6 +2069,16 @@ fn build_dictionary(c: &mut Core) {
* Forth names this "quit", for the reason that calling "quit" in
* the middle of a compiled program is a reasonable way to bring
* you back to top-level.
*
* "quit" is called the "outer interpreter" because it is the outermost
* interpreter loop that Forth uses. Some Forth implementations also
* use an "inner interpreter" to execute their threaded code. Our Forth
* does not have an inner interpreter because we used subroutine
* threading, making our threaded code a list of subroutine calls that
* can be directly executed by the CPU.
*
* Let's look at what "quit" does. We've already done all the hard work
* so it can be quite short.
*/
// quit ( -- )
......@@ -2076,7 +2086,9 @@ fn build_dictionary(c: &mut Core) {
forth!(
quote, /* Read a word from the keyboard and look it up in
* the dictionary */
dispatch, /* Figure out what to do with the word */
quit /* Repeat forever */
/* You might have noticed that "quit" isn't tail-recursive -- it
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment