Refactor object.d: Move __cmp and __equals to rt #2634
Conversation
I think Andrei has been against this in the past due to the compiler needs to read more files. |
Whatever happened to reading zip archives of "precompiled" packages? |
And what's the alternative? Put the entire runtime into object.d? Because that's where we're headed. |
I don't know, that's the first I've heard of it. Anyway these files contain templates, so I'm not sure what precompilation can do. |
I’m in favor of this PR. Just pointing out that there’s been talk about this before. |
Can anyone tell me what's failing in the Circle CI and AutoTester CIs? I don't see what the problem is. |
CircleCI seems to be failing due to:
|
The test failures might be related to the changes in |
Yes, but I don't see any difference in that diff, and I can't reproduce it locally. |
The changes in |
I don't see a difference. Whitespace or no printable character? |
I checked whitespace and EOL characters, and everything seems correct. The indent is a tab, but I doublechecked that the files also used a tab character. @wilzbach @thewilsonator Any ideas? |
Dunno. All the results are old though. |
@rainers I'm having a lot of trouble getting this PR to pass the profile test suite and I'm hoping you may have some idea. The problem is the list of exports in I don't know much about what the profile code is doing and why these .exp files even exist. Do you have any knowledge of this that you would be willing to share to help me resolve this problem? |
@JinShil I'm not too familiar with that code, but it seems to me that the makefile allows either mytrace.def.exp or mytrace.releaseopt.def.exp to match the generated file, because the call to __cmp isn't generated in the release build (no code for asserts). I don't know what your previous attempts did, but I guess you should just not add _D2rt5array10comparison__T5__cmpTaZQjFNaNbNiNeMxAaMxQeZi to mytrace.releaseopt.def.exp. |
How can template code be in |
|
Everything immediately made sense after reading that. Thanks! @rainers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of this too. Reading files is cheap, evaluating templates isn't. And if reading files ever becomes an overhead, we can always bundle everything during the release build into one file.
Thanks for your pull request and interest in making D better, @JinShil! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + druntime#2634" |
Do templates get evaluated even when they're not instantiated? |
No semantic analysis is run for templates unless they’re instantiated. |
ping |
This is an exploration into ideas for refactoring object.d so it's not a dumping ground for everything.
This approach utilizes packages and modules more than has been typically done in other D modules in an attempt to leverage D's encapsulation features and isolate things that don't need each other to their own modules.
To make templated lowerings available to the compiler, they are publicly imported into object.d.
I'm not sure how that's going to turn out, hence the draft PR.Those modules that have templated lowerings are copied to theimport
directory so they are available to object.d.cc @Vild @jpf91