Custom attributes (again)
Steven Schveighoffer
schveiguy at yahoo.com
Fri Apr 6 10:49:01 PDT 2012
On Fri, 06 Apr 2012 11:00:25 -0400, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> On 4/6/12 5:06 AM, Walter Bright wrote:
>> On 4/6/2012 2:41 AM, Johannes Pfau wrote:
>>> The last time custom attributes where discussed, a C# like model was
>>> proposed. Is there a good reason why we should deviate from the C#
>>> implementation?
>>
>> C# uses a runtime implementation, not a compile time one.
>
> Speaking of the distinction, it would be great if we arranged things
> such that attributes are a lowering to existing D (i.e. the compiler
> rewrites a nice attribute syntax into clunky D code you wouldn't want to
> write by hand).
>
> Lowerings have worked miracles for us in terms of keeping language
> semantics simple and reducing implementation bugs. We should use them
> wherever appropriate.
I don't think that applies here. We have no low-level mechanism to affect
the compiler internals, which is where attribute metadata belongs.
-Steve
More information about the Digitalmars-d
mailing list