Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!rutgers!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 Message-ID: <2529@pt.cs.cmu.edu> Date: 1 Aug 88 17:24:32 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> Sender: netnews@pt.cs.cmu.edu Organization: Carnegie-Mellon University, CS/RI Lines: 26 Mach2 on a Mac SE does 10000 0 do loop in 1/30 sec (2 ticks)--30 times faster. I think it's hard to generalize about interpreters, because there is more than one way they are implemented. For instance, some Forths store the top couple of items of the parameter stack in registers, instead of memory. Some (like Mach2) have a seperate stack for DO..LOOP use (instead of using the 68000 stack). Some Forths compile (in the Forth sense) a pointer to a routine to allow the inner (or address) interpreter to thread Forth words, while other Forths such as Mach2 compile Forth words to be executed as 68000 subroutines, which are executed by JSR. Several Forths permit colon definitions to be compiled as in-line code, avoiding all threading during execution (but usually using more space). The ones I know about are HSForth and PCForth (both for PCs) and Mach2. One of the things that makes Forth so interesting is that it offers the programmer knowledge and control over the details of compilation, and how routines are factored into in-line code vs. subroutine calls,etc. As such, it is an ideal vehicle for learning how a symbolic representation of a "program" (source code) ends up begin executable (object code). Forth is far better than Pascal (for instance) for appreciating the kinds of things that really happen when you write a program in any language... -- Nicholas Spies ns@cat.cmu.edu.arpa Center for Design of Educational Computing Carnegie Mellon University