Newbie initial comments on D language - RTTI and run-time reflection

Edward Diener eddielee_no_spam_here at tropicsoft.com
Tue Jan 29 19:40:45 PST 2008


Walter Bright wrote:
> Edward Diener wrote:
>> I could go into the major usage of run-time reflection in modern IDE 
>> environments but if I just say RAD programming, ala forms, components, 
>> and design-time manipulation as in C++ Builder and later in Visual 
>> Studio .Net, you can probably extrapolate where I am going with it. I 
>> will just add that C++ as a a standard has been adamantly opposed to 
>> such ideas, but from this programmer's point of view it will be the 
>> way of programming in the future. Without real run-time reflection RAD 
>> programming is nearly hopeless. That is the reason why implementing it 
>> in D and working toward a RAD programming IDE using D would be a major 
>> advantage and selling to using D over and above its additions and 
>> possible improvements to C++ IMO. But I do realize how difficult 
>> adding run-time reflection may be from the compiler's point of view.
> 
> I agree with the importance of RTR (runtime reflection).

Thanks ! Yay !

> 
> But as Andrei and others pointed out to me, with good compile time 
> reflection D can achieve runtime reflection with the addition of a 
> simple call to a library.

I sure do not care whether it is a call to a library or something 
built-in to the D language.

> 
> What this does is enable RTR on an as-needed basis, as throwing it in by 
> default for the whole program will produce executables that are perhaps 
> 2x the current size.

I sure do not mind if a compiler switch is used to add type metadata 
enabling run-time reflection on demand. It would be easy enough to 
provide two forms of a module if necessary; one slimmed down to provide 
only the necessary facility to run and another with all the metadata in 
it to allow a 3rd party mechanism to introspect through its types and 
sub-components for use in a possible RAD programming environment.

I will look at your compile time reflecion mechanisms, if I can 
understand at what to look and where the documentation is. My only 
concern is that a run-time reflection mechanism, IMO, must not have any 
knowledge of types pre-compiled into it, but must be able to query type 
information on-the-fly at run-time. Hopefully that is the case with your 
facility. If it is not, no matter who Andrei is ( Aleandrescu ? ) it can 
  not be, as far as I understand, a run-time reflection mechanism. But 
perhaps my understanding is limited.



More information about the Digitalmars-d mailing list