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,309 of 117,927   
   Paul Rubin to albert@spenarnc.xs4all.nl   
   Re: push for memory safe languages -- im   
   13 Mar 24 18:03:56   
   
   From: no.email@nospam.invalid   
      
   albert@spenarnc.xs4all.nl writes:   
   > So [Algol68] nil + reference takes the same place as NULL + pointer in c.   
      
   I'm unfamiliar with Algol68 but if every reference in it can be set to   
   nil, that sounds like the same error that Algol-W had.  The alternative,   
   using an option value, means: 1) if the reference is not wrapped by an   
   option type, then it is guaranteed to not be null; 2) if it is wrapped   
   by an option type, then the compiler can stop you (or at least warn you)   
   if you try to dereference without first checking that it is non-null.   
      
   > You are supposed to test for this case, but if you fail you get a   
   > "Segmentation fault".  As far as Forth goes, that is pretty   
   > satisfactory security.   
      
   For sure, it is usually better to crash than to keep running and give   
   nonsense answers.  Of course that usually requires a hardware fault on   
   dereferencing a null pointer, rather than giving whatever is at location   
   0 in memory like on unprotected machines.   
      
   Beyond not giving wrong answers, it's usually nice if your program   
   doesn't crash too often, especially from program bugs.  Getting help   
   from the compiler for that is often useful.   
      
   --- 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