Trusted Manifesto

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 9 21:04:28 PST 2015


On 2/9/15 11:18 PM, Zach the Mystic wrote:
> On Tuesday, 10 February 2015 at 04:05:35 UTC, Andrei Alexandrescu wrote:
>> On 2/9/15 8:03 PM, Zach the Mystic wrote:
>>> You could put the 'trusted' template right in object.d, to save people
>>> the awkward burden of importing it from std.conv all the time. But that
>>> would be a language change, of sorts.
>>
>> We won't define it. Instead we'll go with Steve's idea: () @trusted =>
>> expr. It's not much longer and it's a teensy bit more awkward -
>> exactly what the doctor prescribed. -- Andrei
>
> People were worried about reliable inlining, but maybe the compiler can
> just guarantee that somehow. Aren't we back where we were before? The
> only addition we were recommending is the equivalent of only allowing
> @trusted lambdas like the one above in @trusted and @system functions,
> but not in @safe ones.

IIRC, gdc and ldc already do this.

This is not an issue that should dictate convention, non-inlined code 
does not impact correctness, only performance. And once it is fixed in 
the compiler, the argument would be gone, and we would be left with a 
convention with no good reason.

-Steve


More information about the Digitalmars-d mailing list