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

Walter Bright newshound2 at digitalmars.com
Fri Jan 3 01:31:26 UTC 2020


On 1/2/2020 9:27 AM, Arine wrote:
> If you could annotate the module with @system to use the old behavior, this will 
> ease the transition period. This is better than simply having a compiler flag 
> that changes behavior, as you can see in the code that is using the old 
> behavior. You can also disable it per module, not either on or off for everything.
> 
>      @system module std.stdio; // or similar

We already have that in starting a module with:

     @system:


> C# and Rust both are first class citizens for safety, they don't require hacks 
> like using a lambda to declare a section of code as unsafe as you have to do in D.
> 
> 
> @safe void foo() {
> 
>      // ...
> 
>      () @trusted {
>          // ...
>      } ();
> 
>      // ...
> }
> 
> Since this DIP is so bare bones anyways, I'd be inclined to include these 
> changes as part of this DIP.

This DIP is not about changing how trusted code is inserted. If you'd like to 
discuss that, please start a separate thread. Please keep this thread on-topic 
about the DIP.


More information about the Digitalmars-d mailing list