From: user5857@newsgrouper.org.invalid   
      
   anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:   
      
   > John Levine writes:   
   > >I didn't port a lot of code from the 11 to other machines, but my   
   recollection   
   > >is that the widespread assumption in Berkeley Vax code that location zero   
   was   
   > >addressable and contained binary zeros was much more painful to fix than   
   > >size issues.   
   >   
   > Sure, lots of things are more painful to fix, but Thomas Koenig's   
   > claim was that if the 64-bit machines would not run FORTRAN code "as   
   > is", nobody would buy them.   
   >   
   > Concerning pain, I found that in Gforth (which contains C code and   
   > Forth code) we had many more portability bugs in the C code than in   
   > the Forth code, where we had almost no portability bugs.   
      
   C, itself, would be3 a "lot less painful" if C only had 2 integer types   
   1-word and 2-words. But, instead, they typical 2^(n+3) machines have   
   8-integer types (Signed, unSigned}×{Byte, Half, Word, DBLE}, and then   
   to make it as bad as possible, there are a myriad of types {ptr_dif,   
   size_t, off_t, ...} that change {Sign}×{Size} on an architecture basis.   
      
   > That's because Forth has only two integer types: cell (a machine word)   
   > and double cell (two machine words); and if you use one instead of the   
   > other, the code fails, whatever the cell size is.   
      
   Same as FORTRAN.   
      
   > By contrast, in the C code we have to deal with a large number of   
   > integer types (not just int, long, etc., but also, e.g., off_t), with   
   > the relations between the types being different on different   
   > platforms, or, in the case of off_t, also depending #defines. On one   
   > machine some function parameter was a long or whatever, on a different   
   > one it was a bla_t or whatever. Of course, these days one might   
   > target only Linux and MacOS and reach >99% of desktops and servers   
   > (the result runs on Windows through WSL2), but that solves the problem   
    ^only   
   > by reducing the portability requirements.   
      
   Blame goes to:: ISO/IEC 9899:1999 for trying to accommodate everyone   
   and ending up screwing everyone.   
      
   > - anton   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|