[NOTABLE PR] First step from traditional to generic runtime

rikki cattermole via Digitalmars-d digitalmars-d at puremagic.com
Thu Mar 2 19:13:58 PST 2017


On 03/03/2017 4:06 PM, Adam D. Ruppe wrote:
> On Friday, 3 March 2017 at 02:59:57 UTC, rikki cattermole wrote:
>> If we end up full on templated TypeInfo that would be lovely.
>>
>> TypeInfo_Class clasz = TypeInfo_ClassT!Foo;
>>
>> class TypeInfo_ClassT(T) if(is(T == class)) {
>>     version(FullReflection) {
>>         string[] methodNames() { ... }
>>     }
>> }
>
>
> We already have the capability to do that with the existing dmd and
> druntime - RTInfo is a template instantiated for each type, linked into
> TypeInfo, so we can extend it... if we are willing to edit object.d.
>
> What is really nice about templating TypeInfo though is removing some
> annoying code from druntime and also being able to tweak that in
> constrained environments.... we can already add anything we want, being
> able to *remove* is what's going to be new.

Yeah, once it is fully template based it gives us the ability to 
actually play with TypeInfo and not have to go modify the compiler on 
any set of changes. So while we do have RTInfo, we don't have this 
freedom to change and adapt it like we could and this PR moves us 
towards that hopefully.


More information about the Digitalmars-d mailing list