Safer D first draft

Lance Bachmeier no at spam.net
Mon Sep 23 18:34:57 UTC 2024


On Monday, 23 September 2024 at 15:49:28 UTC, Walter Bright wrote:
> On 9/23/2024 6:50 AM, Lance Bachmeier wrote:
>> I agree. I'd actually go a bit further and say that if it's 
>> turned on by default, if anything, the effect would be to give 
>> users a false sense of security - they'd be confused why 
>> checks here and there are missing (I certainly wouldn't 
>> understand the reasoning).
>
>
> Consider:
> ```
> int* foo(int i)
> {
>     return &i;
> }
> ```
> which gives an error today by default. I don't think this is 
> confusing.

It's not that the individual checks are confusing. It's the 
opposite. The confusing part would be the cases that aren't being 
checked. There would be no reason for someone new to the language 
to know that they're getting a set of "almost safe" checks on 
their program. I can't imagine implementing something like this 
without making it opt-in.


More information about the dip.development mailing list