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

Steven Schveighoffer schveiguy at gmail.com
Mon Jan 13 20:32:32 UTC 2020


On 1/13/20 1:38 PM, bachmeier wrote:
> On Monday, 13 January 2020 at 17:33:12 UTC, Steven Schveighoffer wrote:
> 
>> I've also seen a lot of assertions that all documentation and 
>> tutorials (ALL) will be broken.
> 
> That was probably me. I don't recall ever saying all documentation and 
> tutorials will be broken, but it will certainly cause problems for a lot 
> of the material out in the wild, and it's the kind of breakage that will 
> make folks run away. It's not just what's written in the 
> documentation/tutorial either. You change one thing in a working example 
> and all of a sudden it no longer compiles. Seriously, who changes to 
> @safe by default in a regular release?

I feel this is a bit blown out of proportion.

I see all the time on stackoverflow answers updated for e.g. newer 
versions of Swift. There's no reason to think the same thing wouldn't 
happen for D.

But I also think it's going to be a very small part of the 
tutorials/docs that are incorrect. Looking at tour.dlang.org, I see the 
following pages that won't work with the DIP defaults:

https://tour.dlang.org/tour/en/basics/memory (basically talks about safe 
D anyway, so it would need an update for sure)
https://tour.dlang.org/tour/en/basics/type-qualifiers (runs fine with 
dip1000, so maybe we need to look at the order in which we turn on the 
various DIP defaults)
https://tour.dlang.org/tour/en/basics/associative-arrays (object.keys is 
not safe, this would need to be fixed before implementation of the DIP)
https://tour.dlang.org/tour/en/basics/exceptions (writeln(e.info) has 
issues with safety, that might not be a problem with the real DIP)

> 
> Ultimately it's up to the DIP author to make the case that this type of 
> breakage won't happen. The author of this DIP did not do that, and 
> anyone else making such a proposal would have it shot down immediately 
> for exactly that reason.

You will have lots of time to get your code ready for the DIP to be the 
default.

-Steve


More information about the Digitalmars-d mailing list