Fixing C's Biggest Mistake

mate aiueo at aiueo.aiueo
Mon Jan 2 11:20:30 UTC 2023


On Sunday, 1 January 2023 at 18:18:57 UTC, Walter Bright wrote:
>> That's great. However, it's somewhat aggravating to me that I 
>> am currently not actually convinced you understand what's 
>> needed to achieve that. This is because you are making 
>> statements that equate nonnull pointers in the type system to 
>> runtime hardware checking with segmentation faults.
>
> Yes, I am doing just that.

I don’t understand how it can be argued that both approaches are 
equivalent. In the hardware case, the null check is done at 
runtime. If the programmer forgets to handle some edge case, the 
bug gets released and affects the customers in production. In the 
type system case, the language ensures that, when the appropriate 
type is used, this bug cannot happen. In other words, that fixes 
the billion dollar mistake.


More information about the Digitalmars-d mailing list