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,690 of 117,927   
   albert@spenarnc.xs4all.nl to do-not-use@swldwa.uk   
   Re: portable or not? Volatile strings   
   14 Aug 24 12:38:55   
   
   In article ,   
   Gerry Jackson   wrote:   
   >On 14/08/2024 08:03, Anton Ertl wrote:   
   >   
   >> However, if we adopt Gerry Jackson's attitude and make every transient   
   >> region permanent, creating a new permanent word (in a separate   
   >> section) for every parsed number, string, etc. is fine, and ticking   
   >> that word is fine, too.  For most programs, the space taken by the   
   >> recognized words is proportional to the size of the source code, which   
   >> is acceptable on desktops with GBs of RAM.  However, programs that use   
   >> EVALUATE a lot will need more recognized-word storage.  A contrived   
   >> example is:   
   >>   
   >> : foo 1000000000 0 ?do s" 123" evaluate drop loop ; foo   
   >   
   >I wasn't clear enough when I suggested making transient areas   
   >'permanent'. Currently transient areas are overwritten either by the   
   >user or the system when it decides to re-use the transient region for   
   >something else. If we take the <# buffer as an example, I meant that the   
   >user would declare the memory to be used for that buffer once and that   
   >would be used thereafter. It's permanent in the sense that the   
   >allocation is permanent, not the contents - the system would not be   
   >allowed to corrupt it. THe user would be free to re-use it or to make   
   >the contents permanent by declaring another bit of memory to be used for   
   >the buffer. If the user ALLOCATEd the memory it could later be FREEd by   
   >the user. The user manages it not the system.   
      
   Constant strings should not be stored in a "transient area".   
   Then trigger endless discussion for how long transient means.   
      
   You are near my idea's of : $! $@ $+! $C+ $/   
   Have low level abstractions of strings, but do not mix the   
   storage requirements of this strings into these low level abstraction.   
      
   Example   
   CREATE $VAR1 100 ALLOT   
   "AAP"  \ is permanent. (somehow )   
   2DUP $VAR1 $!   \ You take responsibilty that `$VAR is large enough   
   \ The constant string is still on the stack and can be reused.   
      
   >   
   >--   
   >Gerry   
   >   
   Groetjes Albert   
   --   
   Don't praise the day before the evening. One swallow doesn't make spring.   
   You must not say "hey" before you have crossed the bridge. Don't sell the   
   hide of the bear until you shot it. Better one bird in the hand than ten in   
   the air. First gain is a cat purring.            - the Wise from Antrim -   
      
   --- 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