New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DDMD] Current patch list #1980
Conversation
One remaining problem with the conversion is the inability to model the spreaded class implementations, e.g. expression.c, in D. I do remember this came up as an argument for why we need better header/implementation separation. I will try to find that post. Given that a solution for header/implementation files will take a while, do you have any other approach to solve this. |
This is not a problem. With extern(C++) classes, it is quite reasonable to implement some of the member functions in C++ (just no special member functions). Long term, this problem can be avoided by using real visitor classes, but that can wait until the port is complete. |
OK, you can have some C++ methods, but it's still not possible to split the implementation to expression.d and e2ir.d for example. We'll have a solution to this, but I wonder if you have any ideas on your own. |
Oh right, that. e2ir is a bad example because it is in the glue layer, and will be left in C++. Interpret on the other hand... I see three options (and one horror):
|
Could anybody on linux64 please bisect the ice for me? |
Problematic, because you end up mixing different compiler parts in a file.
This one is feasible, but it's ugly boilerplate.
It's the same refactoring as in 1 though, so I think it would be a better option.
Fairly simple though. |
My main reasons to prefer 1 over 3 are that a) it will break lots of pull requests (but I guess this will happen anyway eventually) and b) large refactorings are harder to get merged. If you or anybody else would like to work on this I will be happy to merge it. An easy first target would be the linux C++ mangling code, as this only need to touch If you have time, please take a look at my DDMD pull requests. They are multiplying. |
Now only 68 link errors (44 constructors called from the glue layer, 4 destructors, 9 Array/ArrayBase methods, 6 variadics, 5 misc) |
thisisawesome |
Down to 9 link errors - almost up to the yummy wrong code and memory corruption errors! |
Idea: we should publish the C++->D conversion program in tools/. If it can convert dmd, it should also be able to convert a variety of idiomatic C++ programs to D, too! |
I'll take it you haven't had a look at the actual code! While this sounds nice in theory, the reality is the conversion tool is saturated with special cases and makes some very bold assumptions about the code. The approach used could be very useful to other projects, but the tool itself is one-shot. |
This sounds great. |
Update: I hacked around all the remaining link errors, and it now compiles and links! Then it fails with a stack trace showing functions that never call each other calling each other, but at least it's progress. |
Amazing! |
Exciting update! With the glue layer/backend stubbed out, all of the compilable tests and almost all of the fail_compilation tests generate the correct result! The 'failing' fail_compilation tests are all caused by errors being incorrectly detected in the glue layer instead of the frontend. Eg invalid array ops, bad vtables, vtable shadowing, struct init circular reference, multiple mains, bad casts.
Bugs I recently encountered came from:
|
Now self-hosts on win32, and passes the dmd test suite on easy mode (no flag permutations) for everything except It compiles in ~3.3 seconds and compiles itself in ~4 seconds! Currently segfaults when trying to compile druntime, but it's only a matter of time now... |
Now self-hosts, passes the test suite, and builds druntime and phobos (passing all unittests) on win32. |
What's the next step? |
Sorry, I thought I replied to this ages ago. I posted an update on the newsgroup. |
Down to 21! |
17 |
15 remaining - now builds itself on linux64! |
Keep up the good work! |
Yay, linux. What do I have to do to try it out? |
Pull this branch and build dmd with it. (and druntime/phobos)
So you may need to change It segfaults trying to build the tester tool, but does seem to build itself successfully. Good luck! |
Only 9 remaining:
The converter has recently been extended to emit converted declarations into multiple D source files. It is in the process of being upgraded to preserve comments. Expect source previews soon! |
Wow, this list has become short.
The one by Igor Stepanov (#2074)? |
Yeah, we might make it to D before dconf after all!
Yep! Hopefully that will be ready soon. |
New milestone: We've reached zero patches needed for the _host_ compiler. The rest are all for treating the source code that is fed into the converter. This means, unless new issues come up, the 2.066 release will be capable of building the d compiler. |
Good stuff. Keep the pulls coming, I'll be on standby and review as they come. |
Great, maybe you also want to add some DDMD milestones to the Agenda. |
Fixed up your triple t in htttp linky. :p |
Slowly getting there...
|
@WalterBright @andralex @AndrejMitrovic @9rnsr @MartinNowak @ibuclaw @klickverbot @braddr Today we've passed a very important milestone - the conversion tool can now work on our unmodified git-head. (tested on win32/linux32/linux64) Huge thanks to everyone who has reviewed my pull requests over the last ~10 months - over 250 pulls in total. The next step will be cleaning up some minor formatting issues in the generated source and pushing it into this repo. My plan is to add new targets to the makefiles to convert the source and build ddmd, while leaving the C++ build intact (for now). |
Getting this into our build system and later into the auto-tester sounds like a good plan. |
@MartinNowak: I'm not sure if Also, we should set up a CI system for the D port ASAP to make sure |
DO NOT MERGE
This is a bunch of patches currently required to get the autoconversion working. Not all of these are planned to go into the compiler as-is.
This is mostly so I can tell if I'm breaking things on other platforms, but feedback is also welcome.
DO NOT MERGE
Current status: