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,807 of 117,927   
   Ruvim to Anton Ertl   
   value-flavoured structures (was: Avoid t   
   27 Sep 24 12:15:48   
   
   From: ruvim.pinka@gmail.com   
      
   On 2024-09-15 20:16, Anton Ertl wrote:   
   > Stephen Pelc  writes:   
   [...]   
   >> However, higher level source code has been much   
   >> in demand. An example is Nick Nelson's value flavoured structures,   
   >> which are of particular merit when converting code from 32 bit to   
   >> 64 bit host Forths.   
   >   
   > Gforth has worked on 64-bit hosts since early 1996, and I found that   
   > Forth code tends to have fewer portability problems between 32-bit and   
   > 64-bit platforms than C code, and that's not just my code, the   
   > applications in appbench and many others are also quite portable.   
   >   
   > A major merit for value-flavoured structures is that you can change   
   > the field size (e.g, from 1 byte to 2 bytes or vice versa) without   
   > changing all the code accessing those fields.  That's independent of   
   > cell size.   
      
   Yes, you can change the field size, but only as far as its value   
   occupies the same number of a stack items and the stack is the same.   
      
   For example, it's impossible to change n to d, n to r, or vice versa,   
   without changing all the code accessing those fields.   
      
   Similar for the word `to` — `to` applies to the words created with   
   `value`, `fvalue`, `2value`. But the source code around `to foo` (and   
   `foo`) depends on the kind of `foo`, so the kind of `foo` cannot be   
   changed without changing the source code around where it is used.   
      
      
   Higher level (more polymorphic) source code in Forth is possible when   
   all values are boxed [1]   
      
      
   [1]    
      
      
   --   
   Ruvim   
      
   --- 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