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,951 messages   

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

   Message 116,731 of 117,951   
   albert@spenarnc.xs4all.nl to dxforth@gmail.com   
   Re: Avoid treating the stack as an array   
   13 Sep 24 13:07:32   
   
   In article <66e40a42$1@news.ausics.net>, dxf   wrote:   
   >On 13/09/2024 5:56 pm, minforth wrote:   
   >> On Thu, 12 Sep 2024 23:37:29 +0000, dxf wrote:   
   >>   
   >>> On 12/09/2024 8:19 pm, Anton Ertl wrote:   
   >>>> Register allocation is one of the most effective optimizations in   
   >>>> compilers.  That's also true of Forth.   
   >>>>   
   >>>>> Costs multiply in the face of many small functions.   
   >>>>   
   >>>> Register allocation is also effective for small functions.   
   >>>   
   >>> Moore talked about registers.  It's worth repeating for those who may be   
   >>> new   
   >>> to forth.   
   >>>   
   >>> "But such registers raises the question of local variables.  There is a   
   >>> lot of   
   >>>  discussion about local variables.  That is another aspect of your   
   >>> application   
   >>>  where you can save 100% of the code.  I remain adamant that local   
   >>> variables   
   >>>  are not only useless, they are harmful.  If you are writing code that   
   >>> needs   
   >>>  them you are writing, non-optimal code" - Chuck Moore 1999   
   >>   
   >> The only thing that can be deduced from this is that back in 1999   
   >> this was Moore's opinion in the specific context of his work.   
   >>   
   >> Besides, the world has changed a wee bit since then...   
   >   
   >Claims made in respect of locals in forth - ease of use, better performance   
   >through less 'stack juggling', better readability/maintainability - were all   
   >made in the 1980's.  What has changed?  Forthers today are more willing to   
   >believe, to accept the word of authority, lack the interest to discover the   
   >truth for themselves?  If so, that would be a pity.   
      
   I object to locals because it introduce a superfluous extra concept.   
   It is foreign to a stack oriented language.   
   Also there are numerous conflicting notations, and giving a name to a   
   single cell, isn't sufficient. You need not local doubles, floats and   
   structures.   
   There are people fond of their information hiding aspect, that can   
   easily be done with normal data and an addition like marking   
   some words private.   
   The remaining argument is re-entrancy, an overrated argument.   
      
   I am also fond of Algol68/go. A different end of the spectrum,   
   but it has a common feature that Forth has: consistency.   
   Local variables break that.   
      
   I don't take Moore's word for gospel, but I pay attention, because   
   he is an accomplished individual.   
      
   Groetjes Albert   
   --   
   Temu exploits Christians: (Disclaimer, only 10 apostles)   
   Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall   
   Art For Home, Office And Garden Decor - Perfect For Windows, Bars,   
   And Gifts For Friends Family And Colleagues.   
      
   --- 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