Fixing C's Biggest Mistake

Timon Gehr timon.gehr at gmx.ch
Fri Dec 30 21:07:15 UTC 2022


On 12/30/22 21:41, Walter Bright wrote:
> On 12/29/2022 7:37 PM, Timon Gehr wrote:
>> I am not saying software can't be allowed to fail, just that it should 
>> fail compilation, not at runtime.
> 
> In your description of pattern matching checks in this thread, the check 
> was at runtime.
> ...

No, the check was at compile time. The check I care about is the check 
for _failure_. The check for _null_ may or may not be _necessary_ 
depending on the type of the reference. Relying on hardware memory 
protection to catch the null reference is never necessary, because 
_valid programs should not even compile if that's the kind of runtime 
check they would require to ensure type safety_. The hardware memory 
protection can still catch compiler bugs I guess.

> (Of course, we'd all like the compiler to detect all the errors at 
> compile time. D does an awful lot of that.)
> 

Well, glad we are on the same page at least. But what is the concern 
then? This technology has a proven track record.


More information about the Digitalmars-d mailing list