Discussion Thread: DIP 1028--Make @safe the Default--Final Review

Walter Bright newshound2 at digitalmars.com
Mon Apr 6 02:43:51 UTC 2020


On 4/5/2020 12:22 PM, Timon Gehr wrote:
> I really doubt that. It's a simple rule. The version that is easiest to 
> implement is you simply disallow extern(C) functions without body to be marked 
> @safe. It's a single `if` statement in an appropriate place.

Famous last words.

Just look at the swamp of misery from "simple" C rules, such as their effect on 
C++ overloading. The quagmire got a lot worse when C++ added type inference. I 
attended a Scott Meyers talk that was a full hour long just on the weird special 
cases forced on C++ due to those simple rules. Companies pay Scott a boatload of 
cash for these lectures.

I wouldn't be surprised if more than half of the bugs in bugzilla are the result 
of an unexpected interaction between simple exceptions to rules.

I've been around this block a few thousand times. Remember, it ain't just the 
compiler. The users don't remember these exceptions. Every one of them makes the 
language harder to learn and master.


More information about the Digitalmars-d mailing list