refactor expression.h: remove fields unused by backend#5975
refactor expression.h: remove fields unused by backend#5975WalterBright wants to merge 1 commit intodlang:masterfrom
Conversation
14382e2 to
f42cd97
Compare
|
Does this work ? |
|
Ah I get it. you removed all the members. |
|
I don't think this is a good idea. It makes it harder for other compiler backends (or other tools when using the front end as a library in the future). For example, LDC uses code like IIRC the plan was to autogenerate the C++ header files in the long run. |
|
Ehhh this doesn't seem like a good idea. |
|
I generally dislike .d and .h going out of sync. I find it absolutely natural that the C++ header corresponds to the D implementation. Hiding members this way for C++ bindings (and ending up with different type sizes etc.) seems a particularly bad idea to me. |
|
Yep, this seems like a bad idea. Now, these changes might not break LDC in particular (I didn't check), but:
I'm all for a cleaner AST interface to the glue layer (with a well-defined "canonical" form of the AST, and a verification pass to check that expression types match up, etc.), but this seems like the wrong way towards this goal. Doing this incrementally like that will just leave behind a big mess. Also, what about marking the fields private to avoid the ABI mismatch? |
|
It's a common and reasonable approach to encapsulation when using virtual functions (I've even used it with D in object.d). Reducing the coupling from the front end to the back end is a worthwhile goal, and will decrease the brittleness of the .d/.h interface, not increase it. As for the other compilers, isn't that what the Travis CI test does? |
The TravisCI tests only check that other compilers can build dmd. If we did use any of these fields, we wouldn't know until we next sync up our sources with yours. |
|
I have nothing to add to what concerns have already been said. However I will echo the importance of improving the quality of the interface for the back, I just think there are better ways to spend our time doing that. |
That sounds like a good challenge for more automation! Is the increased build time the only thing that is blocking you from doing this or are you still too much out of sync? @klickverbot @JohanEngelen afaik is LDC now (nearly) in sync with DMD? |
|
@wilzbach LDC is pretty much in sync with the
|
I wrote a lengthy rant in the mailing list some time ago. In short travisci is a terrible platform because.
I think I got build suceeding only once. But that required using some memory-saving linker switches, and by using parallel mutex locks to prevent two linkers running at once. But travisci has hardware that ranges from ok to terrible, so builds got killed more than they succeeded. |
I can't confirm that. The Linux multilib job for LDC used to take slightly more than an hour, and that wasn't an issue. The OSX release job used to take almost 50 mins and also worked; I think the jobs got killed after 50 mins on OSX.
We use
True, but again no issue for LDC. What step would take that long?
I recall some limitation, which could be worked around by displaying the raw log, which was always complete. A recent LDC job features almost 15k lines though, which are fully available: https://travis-ci.org/ldc-developers/ldc/jobs/151737315 Note that Travis provides different build environments with different features (memory, CPU cores, boot time etc.): https://docs.travis-ci.com/user/ci-environment. We use the container-based one for Linux. |
The frontend itself is small, but whereas you link against a prebuilt compiler library, I have an entire compiler to build from source. ;-) https://docs.travis-ci.com/user/common-build-problems/#My-build-script-is-killed-without-any-error And it lists other problems I ran into also.
The D2 testsuite. Which is silent except for failures. |
|
Closed for lack of interest. |
|
Also I am currently doing the opposite and adding fields and methods that you leave out of the headers (#6643) |
|
dmd no longer has any need for those .h files, so I leave decisions on how to deal with them up to you and the ldc team. I recommend, however, finding ways to reduce dependency on them. |
|
Well my plan is to align up the C++ codebase to the stable branch just enough so I can begin testing bootstrapping the D frontend on gdc without having to maintain a separate copy. Reducing dependence would entail another top-down rewrite. But not impossible, just wouldn't hold my breath for it to happen. :-) |
Back end .h files should be on a need-to-know basis.