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

Walter Bright newshound2 at digitalmars.com
Fri Jan 3 22:49:31 UTC 2020


On 1/3/2020 12:02 PM, bachmeier wrote:
>> What it will do is necessitate labeling code with @system that were always 
>> @system already.
> I'll send you my code and hopefully you can make all the necessary changes in a 
> timely manner. Frankly, I'm shocked that you all of a sudden think major 
> breaking changes in the language are no big deal.

No refactoring, changing data structures, anything like that, will be required. 
It's just adding @system where the compiler indicates. Most of the job will be 
simply adding:

    @system:

to the beginning of the file. Something similar to this was done to the DMD 
backend after it was converted to D - a bunch of `nothrow:` lines were inserted 
at the beginning of the modules. Didn't take more than a few minutes.


> What really has me puzzled is that this is a change with such a limited benefit. 
> D already has @safe. If you want to make safe by default an option, add a -safe 
> flag to the compiler

This feature is enabled with -preview=safedefault. You'll have years to it which 
to pick a time to annotate with @system as required.


> and the problem is solved with no code breakage and no 
> confusion, and you can appeal to the tiny sliver of programmers Rust was created 
> for and that will never be interested in D anyway. Breaking changes can be good, 
> but careful thought needs to be used to minimize the cost of those changes.

Rust has changed the conversation. Major languages are all already safe by 
default, or are moving that direction. We don't have a choice.







More information about the Digitalmars-d mailing list