DIP1028 - Rationale for accepting as is

ag0aep6g anonymous at example.com
Sun May 24 10:50:53 UTC 2020


On 24.05.20 10:55, Walter Bright wrote:
> I infer your position is the idea that putting @trusted on the 
> declarations isn't greenwashing, while @safe is.

That's just arguing semantics. Your intended meaning of "greenwashing" 
is apparently slightly different from Timon's.

You can call this greenwashing:

     @trusted extern (C) void whatevs(parameters);

And this:

     @safe extern (C) void whatevs(parameters);

And then you must also call this greenwashing when compiled with 
`-preview=safedefault`:

     extern (C) void whatevs(parameters);

They all do the same thing.

But the first one is the most preferable form, because it shows up when 
you search for "@trusted" which is our "here be dragons" sign.

The second one should be deprecated in favor of the first one. That 
would move us one baby step closer to the ideal: "@safe code is memory 
safe, unless someone made a mistake with @trusted."

The third one moves us one step further away from that ideal. That's the 
wrong direction. It's greenwashing by default. And since greenwashing is 
bad, greenwashing by default means bad by default.


More information about the Digitalmars-d-announce mailing list