DIP1028 - Rationale for accepting as is

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Fri May 22 19:09:45 UTC 2020


On Friday, 22 May 2020 at 18:32:59 UTC, Steven Schveighoffer 
wrote:
> So the solution is -- make the compiler be dumb for you? If you 
> are going to incorrectly put @safe on it, I want you to have to 
> do it because YOU made a conscious decision to be careless, not 
> have it done for you because you forgot.

Yea, agreed.  If a library works around an extern(C) API by 
slapping `@safe:` on it, this is a visibly problematic thing to 
do, and people can file bug reports and patches about it.  And we 
can have well documented warnings about this being a bad way to 
do things.

If a library just gets extern(C) APIs as @safe by default, then 
it's not visibly obvious that this is problematic.

I would much rather have the problematic thing as something 
visibly done by the developer, than automatically done by the 
compiler.


More information about the Digitalmars-d-announce mailing list