Super-dee-duper D features

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Mon Feb 12 09:06:13 PST 2007


janderson wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> janderson wrote:
>>> Note: I'm not arguing that meta-programming should be higher priority 
>>> then say reflection.  I'm just arguing that its just an extension to 
>>> what programmers do on a day-to-day basis.
>>
>> But metaprogramming *gives* reflection (as even you and others 
>> discussed recently). The half-assed way to do reflection is to have 
>> the language implementer sit down and define the run-time reflection 
>> mechanism. The full-assed way is to define compile-time reflection, to 
>> then allow people to define and refine run-time reflection mechanisms 
>> as libraries, in addition to many other useful libraries! It's like in 
>> the fish vs. fishing parable.
> 
> I agree but its like the stl vectors.  I'm unsure weather it just is 
> easier to have that kinda thing in the language because it already has 
> much of that information. 

The information being there is all the more reason to make it available 
during compilation, for reflection and many other purposes, e.g. PyD 
being one of them.

>Also to write a reflection program that 
> doesn't require wrapping each and every call you'd need to write a fully 
> fledged compiler which may become out of sync with the compiler.   I'm 
> undecided on this matter.

Not sure I understand. All that will be needed to make Widget available is:

mixin Manifest!(Widget);

I don't see where the syncing problem occurs.


Andrei



More information about the Digitalmars-d mailing list