Jump to page: 1 2
Thread overview
[NOTABLE PR] First step from traditional to generic runtime
Mar 02, 2017
sarn
Mar 03, 2017
rikki cattermole
Mar 03, 2017
Adam D. Ruppe
Mar 03, 2017
rikki cattermole
Mar 03, 2017
Walter Bright
Mar 03, 2017
Dukc
Mar 03, 2017
Walter Bright
Mar 03, 2017
Kagamin
Mar 03, 2017
Jacob Carlborg
Mar 06, 2017
Kagamin
Mar 16, 2017
Kagamin
March 02, 2017
Worth a look: https://github.com/dlang/druntime/pull/1781. This moves comparison code away from tedious runtime-introspected routines to nice templates. -- Andrei
March 02, 2017
On Thursday, 2 March 2017 at 19:32:23 UTC, Andrei Alexandrescu wrote:
> Worth a look: https://github.com/dlang/druntime/pull/1781. This moves comparison code away from tedious runtime-introspected routines to nice templates. -- Andrei

Great news :)
March 03, 2017
On 03/03/2017 8:32 AM, Andrei Alexandrescu wrote:
> Worth a look: https://github.com/dlang/druntime/pull/1781. This moves
> comparison code away from tedious runtime-introspected routines to nice
> templates. -- Andrei

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() { ... }
	}
}

But just a thought.
March 03, 2017
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.
March 03, 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.
March 02, 2017
On 3/2/2017 11:32 AM, Andrei Alexandrescu wrote:
> Worth a look: https://github.com/dlang/druntime/pull/1781. This moves comparison
> code away from tedious runtime-introspected routines to nice templates. -- Andrei

It also moves logic from the compiler to druntime, where it becomes much more easily adapted to users' requirements.
March 03, 2017
On Thursday, 2 March 2017 at 19:32:23 UTC, Andrei Alexandrescu wrote:
> Worth a look: https://github.com/dlang/druntime/pull/1781. This moves comparison code away from tedious runtime-introspected routines to nice templates. -- Andrei

This means that if I don't use the templated features, they don't affect my program size nor prevent compilation for platforms where they aren't implemented or have errors.

Did I understand right?


March 03, 2017
On 3/2/2017 11:04 PM, Dukc wrote:
> On Thursday, 2 March 2017 at 19:32:23 UTC, Andrei Alexandrescu wrote:
>> Worth a look: https://github.com/dlang/druntime/pull/1781. This moves
>> comparison code away from tedious runtime-introspected routines to nice
>> templates. -- Andrei
>
> This means that if I don't use the templated features, they don't affect my
> program size nor prevent compilation for platforms where they aren't implemented
> or have errors.
>
> Did I understand right?

That's right. Of course, that was true before, too. What the templates do is put the ABI under user control.
March 03, 2017
Nitpick: object.d is for symbols visible to user code, but it's not necessary to provide these helper functions to used code, so they should be in a different module known to the compiler.
March 03, 2017
On 2017-03-03 16:16, Kagamin wrote:
> Nitpick: object.d is for symbols visible to user code, but it's not
> necessary to provide these helper functions to used code, so they should
> be in a different module known to the compiler.

Exactly https://github.com/dlang/druntime/pull/1781#issuecomment-283904287

-- 
/Jacob Carlborg
« First   ‹ Prev
1 2