Spec#, nullables and more

retard re at tard.com.invalid
Sat Nov 6 14:04:13 PDT 2010


Sat, 06 Nov 2010 21:52:22 +0100, Jérôme M. Berger wrote:

> FeepingCreature wrote:
>> Walter Bright Wrote:
>>> All that does is reinvent the null pointer seg fault. The hardware
>>> does this for you for free.
>> 
>> Walter, I know you're a Windows programmer but this cannot be the first
>> time somebody has told you this - YOU CANNOT RECOVER FROM SEG FAULTS
>> UNDER LINUX.
>> 
>> Access violations are not a cross-platform substitute for exceptions.
> 
> 	I really, really hope that you can't recover from seg faults on
> Windows (or MacOS for that matter). Segmentation faults should be non
> recoverable: once the program has started accessing memory that it
> shouldn't, there is no way to guarantee that the program is in a
> coherent state. Walter has stated this several times and I agree with
> him 100% on this.

I also agree with him 100% on this.

The problem non-nullable types try to solve is they reduce the number of 
possible segfaults in the first place. I don't care how hard the program 
crashes. I just don't want my client to experience that ever. Segfaults 
are terribly common in C/C++ code. I experience those every week. My 
initial motivation to study/use D was born from these crashes. I can't 
believe you're not using every possible known mechanism to prevent them.


More information about the Digitalmars-d mailing list