digitalmars.D - [NOTABLE PR] First step from traditional to generic runtime
- Andrei Alexandrescu (3/3) Mar 02 2017 Worth a look: https://github.com/dlang/druntime/pull/1781. This moves
- sarn (3/6) Mar 02 2017 Great news :)
- rikki cattermole (9/12) Mar 02 2017 If we end up full on templated TypeInfo that would be lovely.
- Adam D. Ruppe (9/16) Mar 02 2017 We already have the capability to do that with the existing dmd
- rikki cattermole (6/23) Mar 02 2017 Yeah, once it is fully template based it gives us the ability to
- Walter Bright (3/5) Mar 02 2017 It also moves logic from the compiler to druntime, where it becomes much...
- Dukc (6/9) Mar 02 2017 This means that if I don't use the templated features, they don't
- Walter Bright (3/11) Mar 03 2017 That's right. Of course, that was true before, too. What the templates d...
- Kagamin (3/3) Mar 03 2017 Nitpick: object.d is for symbols visible to user code, but it's
- Jacob Carlborg (4/7) Mar 03 2017 Exactly https://github.com/dlang/druntime/pull/1781#issuecomment-2839042...
- Andrei Alexandrescu (5/8) Mar 03 2017 Fundamentally the code resulting from lowering must be in the standard
- Kagamin (7/7) Mar 06 2017 v1==v2;
- Andrei Alexandrescu (2/9) Mar 06 2017 Interesting idea, will keep it in mind. Thanks! -- Andrei
- Kagamin (17/29) Mar 16 2017 Even better:
- Andrei Alexandrescu (5/33) Mar 16 2017 A public import inside object.d is not useful because essentially it
- Andrei Alexandrescu (3/6) Mar 15 2017 Another notable PR in the same vein:
Worth a look: https://github.com/dlang/druntime/pull/1781. This moves comparison code away from tedious runtime-introspected routines to nice templates. -- Andrei
Mar 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. -- AndreiGreat news :)
Mar 02 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. -- AndreiIf 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.
Mar 02 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.
Mar 02 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: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.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.
Mar 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. -- AndreiIt also moves logic from the compiler to druntime, where it becomes much more easily adapted to users' requirements.
Mar 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. -- AndreiThis 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?
Mar 02 2017
On 3/2/2017 11:04 PM, Dukc wrote:On Thursday, 2 March 2017 at 19:32:23 UTC, Andrei Alexandrescu wrote:That's right. Of course, that was true before, too. What the templates do is put the ABI under user control.Worth a look: https://github.com/dlang/druntime/pull/1781. This moves comparison code away from tedious runtime-introspected routines to nice templates. -- AndreiThis 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?
Mar 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.
Mar 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
Mar 03 2017
On 3/3/17 10:16 AM, 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.Fundamentally the code resulting from lowering must be in the standard language, i.e. no "magic" artifacts, no hidden symbols, no special rules. The lowering should be as if the user replaced the code with the lowered version by hand. -- Andrei
Mar 03 2017
v1==v2; can be lowered as { import rthelpers:cmp; cmp(v1,v2); } or something like that
Mar 06 2017
On 3/6/17 8:42 AM, Kagamin wrote:v1==v2; can be lowered as { import rthelpers:cmp; cmp(v1,v2); } or something like thatInteresting idea, will keep it in mind. Thanks! -- Andrei
Mar 06 2017
On Monday, 6 March 2017 at 18:06:27 UTC, Andrei Alexandrescu wrote:On 3/6/17 8:42 AM, Kagamin wrote:Even better: in object.d: --- public import _d_helpers=core.helpers; --- lowering: --- v1==v2 to _d_helpers.cmp(v1,v2) --- This has the best scalability and zero possibility of code breakage and probably can be done right now. Also since the renamed import must be referenced explicitly, it doesn't need to be processed until used.v1==v2; can be lowered as { import rthelpers:cmp; cmp(v1,v2); } or something like thatInteresting idea, will keep it in mind. Thanks! -- Andrei
Mar 16 2017
On 3/16/17 10:52 AM, Kagamin wrote:On Monday, 6 March 2017 at 18:06:27 UTC, Andrei Alexandrescu wrote:A public import inside object.d is not useful because essentially it opens more files to load the same amount of code. Generally, there are a few interesting tradeoffs that govern handling of modularity in object.d. -- AndreiOn 3/6/17 8:42 AM, Kagamin wrote:Even better: in object.d: --- public import _d_helpers=core.helpers; --- lowering: --- v1==v2 to _d_helpers.cmp(v1,v2) --- This has the best scalability and zero possibility of code breakage and probably can be done right now. Also since the renamed import must be referenced explicitly, it doesn't need to be processed until used.v1==v2; can be lowered as { import rthelpers:cmp; cmp(v1,v2); } or something like thatInteresting idea, will keep it in mind. Thanks! -- Andrei
Mar 16 2017
On 03/02/2017 02:32 PM, 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. -- AndreiAnother notable PR in the same vein: https://github.com/dlang/druntime/pull/1792. -- Andrei
Mar 15 2017