On Monday, 26 June 2017 at 18:47:18 UTC, Random D user wrote:
Anyway, I think we could just have a compile time switch for defaults.
Imagine having n libraries with pairwise different required defaults used in your application. Say goodbye to combined compilation, hello n separate required compiler invocations.
Since some projects want to have pure, @safe, immutable by default, but others want to have @system @nogc. And no one wants write attributes more than they have to.
That's why most of what I do is in templates, so the compiler infers them for me, anyway.
Also I think @safe is a little bit broken (because of @trusted and even the very pros (d-devs) seem to get @trusted wrong on a regular basis (at least that's my perception)). Just bite the bullet and use Rust if you want to be actually safe.
Except Rust is in exactly the same boat as D, because the same issues that apply to `@trusted` apply to `unsafe`, as well.
Which reminds me that it would be nice to group attributes as well.Something like this: alias @apiStrict = @safe immutable pure int foo() @apiStrict { return 1; }
That would be useful.
