The future of @safe by default [was Re: dip1000 ...]

Paul Backus snarwin at gmail.com
Mon Jun 13 23:44:51 UTC 2022


On Monday, 13 June 2022 at 22:49:53 UTC, Walter Bright wrote:
> On 6/10/2022 5:46 AM, Steven Schveighoffer wrote:
>> I would love to see a viable safe-by-default DIP get added.
>
> At least we can agree on that!

I think the best proposal so far has been Adam Ruppe's idea to 
make @safe-by-default something you can opt into at the module 
level.

https://dpldocs.info/this-week-in-d/Blog.Posted_2020_01_13.html

If we don't want to change the meaning of the existing `@safe:` 
syntax, we can adopt some new syntax for it (`@safe module foo;`? 
`default(@safe):`?).

As a bonus, Adam's proposal will also give us opt-in "nothrow by 
default" and "@nogc by default" for free.


More information about the Digitalmars-d mailing list