Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!BLIULG11.BITNET!A-PIRARD From: A-PIRARD@BLIULG11.BITNET (Andr'e PIRARD) Newsgroups: comp.lang.forth Subject: Re: Forth/PostScript Message-ID: <8911301433.AA12671@jade.berkeley.edu> Date: 30 Nov 89 08:05:43 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Forth Interest Group International List Organization: The Internet Lines: 43 >quite a few differences between Forth and PostScript. > >5) This next one may be implementation dependent, but the two > interpreters I've looked at allow, even require, that you be able to > call the interpreter recursively. If Forth can be said to *implement* a nonrecursive text interpreter, it's just because one didn't care to. Interpreter recursivity is a simple matter of pushing aside some user variables, but also, worst hitch, that it operates on a dedicated location for input stream text, viz. TIB or BLOCK. Pushing text is not easy, but having the TIB relocatable and pushing it's pointer is not difficult in most systems. But doesn't all this feel the other way round? Shouldn't the basic primitive for interpretation be something called like EVALUATE that would take any string anywhere and interpret it after saving the previous context? Then INTERPRET could be built to invoke EVALUATE with specific input. But, after all, the TIB itself is a shabby concept: would one dare using QUERY in an application and overlay the main input stream? No, QUIT itself should be recursive (and I'd call it something like INTERACT then) and the TIB would be just a local data area made known externally for the purpose of using WORD. This is useful, for example, when a debugger gets to prompt the user for commands. The main disease is that Forth does not envision storage allocation elsewhere than in the dictionary. But if allocation is meant towards recursivity, a heap is not needed, a stack suffices and, again, this is a trivial matter. All in all, plus error recovery, operating system interface and other goodies, this raises Forth towards the rank of usability of other languages in the field of operating systems applications. This was my goal when I wrote Comforth, but I have been hindered by having to comply with standards. Going further would have had me to call it Froth. I wish I had more time and less distance to try convince the ANSI committee about this. Andr'e PIRARD SEGI Univ. de Li`ege B26 - Sart Tilman B-4000 Li`ege 1 (Belgium) A-PIRARD@BLIULG11 on EARN alias BITNET "GOTO hell" he commanded nervously. "Stack full" it refused ironically. But only he smiled.