home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.forth      Forth programmers eat a lot of Bratwurst      117,927 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 116,725 of 117,927   
   Paul Rubin to dxf   
   Re: Avoid treating the stack as an array   
   11 Sep 24 23:51:00   
   
   From: no.email@nospam.invalid   
      
   dxf  writes:   
   >> Looking at an application with 154 colon definitions...   
   > From the same app:   
   > The easiest stack operations (DUP DROP) account for most.   
      
   Is the code for this app available?   
      
   > SWAP averaged 1 in 7 definitions.  OVER 1 in 9.  Is 'stack juggling' a   
   > problem in forth?  It doesn't appear to be.   
      
   The 100+ occurrences of DUP, DROP, and SWAP are either an abstraction   
   inversion (with a smart compiler, the data ends up in registers that   
   could be named by locals) or they are stack traffic whose cost has to be   
   compared with the cost of indexed references to locals in the return   
   stack.  I'd agree that they aren't necessary "juggling" which evokes   
   permuting stuff in the stack outside the usual FIFO order.  That does   
   happpen a little bit though, with OVER, ROT, etc.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca