DIP 1028---Make @safe the Default---Community Review Round 1

Johan j at j.nl
Fri Jan 3 23:30:09 UTC 2020

On Friday, 3 January 2020 at 22:59:53 UTC, Walter Bright wrote:
> On 1/3/2020 5:57 AM, Arine wrote:
>> Then this would be better served as an opt in feature.
> It will be opt-in for a time, that's why it will be enabled 
> with -preview=safedefault

Yes please.

>> Especially if steps aren't going to be taken to ensure it is 
>> easy to maintain backwards compatibility. As someone else 
>> mentions
>> @system:
>> does not give the same behavior and will still break code.
> It's still easy to deal with.

I expect the change of default to be a _lot_ of work to deal with 
at Weka. I think it will not be easy at all, because there is a 
lot of templated code and code checking whether something 
compiles or not (`__traits(compiles)`). Every compiler update 
changes what compiles and does not compiles, and it is almost 
always very hard to track down how that changes the behavior of 
Weka's code. (If something doesn't compile, the error happens in 
a template that cannot be instantiated because some template 5 
layers down is not instantiatable for example. The error won't 
say that of course...)
With the @safe change, I'm expecting 100s of templates that will 
no longer compile or change behavior, and for very few of the 
compile errors will it be obvious what is going on. As said 
before, `@system:` is not going to help.

I have no opinion on whether this is a good change or not. I just 
very much would like to get the message across that this change 
will be very disruptive and so please provide a long deprecation 
time (e.g. something like 2 years).


More information about the Digitalmars-d mailing list