Discussion Thread: DIP 1028--Make @safe the Default--Final Review

Kagamin spam at here.lot
Thu Mar 26 18:31:49 UTC 2020


On Thursday, 26 March 2020 at 14:24:24 UTC, Adam D. Ruppe wrote:
> On Thursday, 26 March 2020 at 14:12:24 UTC, Steven 
> Schveighoffer wrote:
>> I still think this is the appropriate path. We cannot continue 
>> to ignore memory safety as a secondary concern just because C 
>> code is by-default unsafe. Memory unsafe HAS to be opt-in for 
>> any new modern language to succeed.
>
> What frustrates me about these discussions is the facts that 
> slices always check bounds by default. The GC prevents 
> use-after-free bugs by default.
>
> C doesn't do those. So assuming C's problems apply to D is 
> fallacious. Rust's complication is because they wanted to avoid 
> the runtime checks. But D's runtime checks are also a valid 
> solution.
>
> I suspect 95+% of C's problems already are extremely rare in D, 
> yet the @safe advocates never seem to consider this at all.

This. Buffer overflows in D happen solely due to prejudice, when 
people abuse their C reflexes when writing in D, so compulsory 
safety may be useful to educate them to start using slices, but 
seriously, if it wasn't for C junkies the last buffer overflow 
would happen 30 years ago and not a second ago.


More information about the Digitalmars-d mailing list