Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!ukc!tcdcs!vax1!trolfs From: trolfs@vax1.tcd.ie (Tommy) Newsgroups: comp.lang.forth Subject: Making Forth easier to swallow. Message-ID: <44212@vax1.tcd.ie> Date: 30 May 89 11:10:31 GMT Organization: Computer Laboratory, Trinity College Dublin Lines: 65 Request: I was told that there was a 5 part version of Forth for the Mac posted awhile back (not pocketForth). Could someone let me know if they have it? Please? Question: I was very taken by the articles in Forth Dimensions (XI/1) on extra stacks for Forth and local variables. I'd never really thought about using extra stacks and even less about local variables, so it was a real eye opener. Actually, this was my first time getting Forth Dimensions and it gives you some idea of how isolated I am. I know that this topic must have been discussed to death before, but I'm very interested to hear what you (The Netforthers) have to say about using extra stacks and local variables. One of the things discussed was the freeing of the Return stack from holding anything other than return addresses. This idea appeals to me as I always feel uneasy about storing things there. What really interests me though is, if more stacks are needed (and I think they are), what is the minimum number and how can they be best used? (ie, is a floating point stack good programming or - for uniformity - should all parameters be passed only on the parameter stack?) Another thought is the use of local variables. Are more people looking to local variables for easier coding and better readability? And if done well, couldn't local variables make for faster run-time code? Probably, if you had complicated stack manipulations. But even if they don't, their readability would make Forth a LOT more palatable to non-Forth programmers (which would help Forth's image no end). I for one think that Forth's parameter passing and manipulation and also it's stack configuration, should to be built on and expanded if it is to be considered a 'serious' alternative to present day compiled languages. Well, that's what I think (:-). It would be nice know what the experienced Forth programmers on the Net think. Are more stacks needed? Where can they benefit best? Are local variables overall useful or do they take away from the Forth philosophy of "Simple is beautiful"? (Though, I thought John Hayes's implementation, in FD p18, looks very simple and improves readability greatly, where as some of the other implementations didn't.) But, the main question that I'm interested in is "Are extra stacks and local variables going to be made standard?". Then again, maybe it's the Forth novices who are in a better position to know what is needed to make Forth an easier pill to swallow. After all, they (we) still have the bitter after taste. Here is a very simple example of John Hayes's local variables: : add ( a b -- a+b ) { / { mark start of new scope local b / local creates the local variable b and local a / pops the top of stack is in to it a b + } / } releases local variables ; -- Tommy $P-) E-mail: trolfs@vax1.tcd.ie :If you don't get a reply, let me know. Sometimes my mail enters the TZ: : FLAMES HIGH LOW DO I TURN-DIAL LOOP ; IMMEDIATE