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,727 of 117,927   
   Paul Rubin to Hans Bezemer   
   Re: Avoid treating the stack as an array   
   12 Sep 24 00:10:03   
   
   From: no.email@nospam.invalid   
      
   Hans Bezemer  writes:   
   > You comfortable left out the initialization of the stack   
   > frame. Agreed, if ALL values are transferred to the return stack the   
   > overhead is minimal. But how often happens that?   
      
   I don't understand this.  {: a b c :} transfers 3 elements from the   
   parameter stack to the return stack.  That has some cost, but it is   
   offset by avoiding some DUP and similar operations.  Is it relevant at   
   all anyway?  Old fashioned Forth interpreters are pretty fast, and if   
   you're worrying about avoiding a stack transfer here or there, you need   
   an optimizing compiler.   
      
   Adding safety checks has a cost, but once the program appears debugged,   
   I think Forth philosophy is to turn off the checks.   
      
   > True - but that's not the level of abstraction I'm considering. I   
   > think a language should have a well designed core, surrounded by a   
   > constellation of extensions. Like C with its standard library and   
   > Forth with its word sets.   
      
   You might like Lua or Scheme for simple higher level languages with that   
   style of design.  C has some warts but its complexity in terms of   
   keywords doesn't seem much worse than Forth's core words.   
      
   --- 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