Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!SCFVM.BITNET!ZMLEB From: ZMLEB@SCFVM.BITNET (Lee Brotzman) Newsgroups: comp.lang.forth Subject: Re: Multiple Stacks Message-ID: <8906010116.AA10968@jade.berkeley.edu> Date: 1 Jun 89 01:15:14 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 55 I got the following from Mark Martino, who was the original poster of some questions about using multiple stacks. Since I don't have the background to reply with any sort of confidence, I thought you'd all like to try. -- Lee Brotzman (FIGI-L Moderator) -- BITNET: ZMLEB@SCFVM SPAN: CHAMP::BROTZMAN -- Internet: zmleb@scfvm.gsfc.nasa.gov GEnie: L.BROTZMAN -- The government and my company don't know what I'm saying. -- Let's keep it that way. -- Isn't Cold Fusion how Eskimos are made? ------------------< Message Starts >-------------------- Date: Thu, 25 May 89 01:31:43 PDT From: uw-beaver!mtk!marmar@ucsd.edu (Mark Martino) Subject: Re: Multiple Stacks In-Reply-To: <8905241402.AA11788@jade.berkeley.edu> References: Organization: Mannesmann Tally, Kent, WA 98032 > I'm not a graphics programmer, but I think that like everything in >programming, there are tradeoffs here. Additional stacks can make programs >easier to write and, in my humble opinion, easier to read (if you avoid >doing something like my silly example above). But, the more stacks you >have, the more stack pointers you need, and that can slow down the system. >If all the stack pointers can not be kept in registers -- and even the >68000 and VAX processors have a limited number of registers that can be >dedicated to the purpose -- they have to be kept in memory. That means >additional memory accesses for each stack operation, i.e. slower execution. > How many stacks did you have in mind? > > >-- Lee Brotzman (FIGI-L Moderator) Thanks for replying. Your answer cleared up a lot of things for me. I hadn't really thought about a specific number of stacks. PostScript has four stacks. I was trying to think of a way to separate out the different types of PostScript objects instead of putting them all on the operand stack. I don't know a lot about the innards of PostScript, but I read somewhere that a PostScript operand is actually 8 bytes on the stack. Even integers take up that much. The reason for this seems to be to provide all of the necessary overhead information for the larger objects and still keep the stack on even boundaries. Not being formally trained, I don't know if a stack has to be pushed and popped by the same increment all the time or if it can somehow handle different sized objects directly. I realize that PostScript was created over a fairly long period of time by more than one person, but I'd like to create a graphic language for artists that is faster and takes less memory than PostScript. I like Forth and I like PostScript, but I want to be able to extend their compiling/binding features to speed them up. So, in short, I guess I could be talking about as many as a dozen stacks. I have lots of other questions if you can take the time to read them. Thanks for your help so far.