Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!bbn!rochester!pt.cs.cmu.edu!cat.cmu.edu!ns From: ns@cat.cmu.edu (Nicholas Spies) Newsgroups: comp.lang.forth Subject: Re: FORTH and memory Keywords: DO, LOOP, interpreter, aardvarks Message-ID: <2558@pt.cs.cmu.edu> Date: 2 Aug 88 17:51:01 GMT References: <8807211846.AA27919@jade.berkeley.edu> <9428@dartvax.Dartmouth.EDU> <2353@pt.cs.cmu.edu> <1530@crete.cs.glasgow.ac.uk> <132@kolvi.hut.fi> <17597@glacier.STANFORD.EDU> <6700@well.UUCP> Sender: netnews@pt.cs.cmu.edu Organization: Carnegie-Mellon University, CS/RI Lines: 20 "The interpreter is not invoked in a DO...LOOP in Forth" is half true; the Outer Interpreter (invoked by INTERPRET in some Forths) compiles or executes Forth words if in compile or execute mode (indicated by the system variable STATE) and is not involved with DO...LOOP. However, "compiled" Forth code is executed by an Inner (or Address) Interpreter, which follows the threaded Forth code (a list of pointers), eventually unthreading it down to the machine-code primitives that perform the useful work of the program. Forth execution overhead (the work involved in unthreading the list of pointers) varies with the implementation and how many levels of colon definitions that depend on earlier colon definitions there are. However, as I mentioned in an earlier post, some Forth systems do have ways to compile colon definitions as in-line machine code to avoid unthreading overhead for those words during execution. All of this applies to "virtual Forth machines", not the Novix, etc. -- Nicholas Spies ns@cat.cmu.edu.arpa Center for Design of Educational Computing Carnegie Mellon University