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,312 of 117,927   
   albert@spenarnc.xs4all.nl to no.email@nospam.invalid   
   Re: push for memory safe languages -- im   
   14 Mar 24 09:16:55   
   
   In article <87bk7h1v5v.fsf@nightsong.com>,   
   Paul Rubin   wrote:   
   >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.   
      
   Algol68 doesn't crash. It gives a run time error of the type   
    dereferencing a  (   aap)  on line .. of ...   
    called from line .. of ..   
    ..   
    called from line .. of main   
   >   
   >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.   
      
   You can't get much help from the compiler for uninitialised references   
   like this. Either it crashes in the first run or it is insidious.   
      
   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