www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - What about GDC and LDC after DMD becomes D?

reply Shriramana Sharma via Digitalmars-d <digitalmars-d puremagic.com> writes:
Once the front end of DMD becomes fully D, I read that the backend
will also become D, but then what will happen to GDC and LDC whose
backends are C++ IIUC?

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா
श्रीरमणशर्मा
Jul 22 2015
next sibling parent "cym13" <cpicard openmailbox.org> writes:
On Wednesday, 22 July 2015 at 11:42:24 UTC, Shriramana Sharma 
wrote:
 Once the front end of DMD becomes fully D, I read that the 
 backend will also become D, but then what will happen to GDC 
 and LDC whose backends are C++ IIUC?
I don't see an issue there. A compiler is a program that implements a standard, as long as it generates good asm it could be written in brainfuck there would be no reason to care. A D compiler written in D is a symbol, and D was written so that D-programmers could stop writting so much C++ so the idea of a DMD written in D is appealing, but that doesn't mean that all D compilers have to be written in D. The only question is "Do they copy DMD correctly?". There is no doubt that it is doable in C++.
Jul 22 2015
prev sibling next sibling parent reply "Xinok" <xinok live.com> writes:
On Wednesday, 22 July 2015 at 11:42:24 UTC, Shriramana Sharma 
wrote:
 Once the front end of DMD becomes fully D, I read that the 
 backend will also become D, but then what will happen to GDC 
 and LDC whose backends are C++ IIUC?
The Rust compiler is written in Rust but uses LLVM as a backend, like LDC. I don't know the complexities of linking a D frontend with a C++ backend, but if the Rust team can do it, I'm sure that means GDC and LDC will continue to live on.
Jul 22 2015
parent "rsw0x" <anonymous anonymous.com> writes:
On Wednesday, 22 July 2015 at 12:02:50 UTC, Xinok wrote:
 On Wednesday, 22 July 2015 at 11:42:24 UTC, Shriramana Sharma 
 wrote:
 Once the front end of DMD becomes fully D, I read that the 
 backend will also become D, but then what will happen to GDC 
 and LDC whose backends are C++ IIUC?
The Rust compiler is written in Rust but uses LLVM as a backend, like LDC. I don't know the complexities of linking a D frontend with a C++ backend, but if the Rust team can do it, I'm sure that means GDC and LDC will continue to live on.
Both gcc and llvm expose a C api afaik
Jul 22 2015
prev sibling next sibling parent Daniel =?UTF-8?B?S296w6Fr?= <kozzi dlang.cz> writes:
On Wed, 22 Jul 2015 17:12:14 +0530
Shriramana Sharma via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 Once the front end of DMD becomes fully D, I read that the backend
 will also become D, but then what will happen to GDC and LDC whose
 backends are C++ IIUC?
 
They will use same dmd frontend written in D.
Jul 22 2015
prev sibling parent reply "Kai Nacke" <kai redstar.de> writes:
On Wednesday, 22 July 2015 at 11:42:24 UTC, Shriramana Sharma 
wrote:
 Once the front end of DMD becomes fully D, I read that the 
 backend will also become D, but then what will happen to GDC 
 and LDC whose backends are C++ IIUC?
Hi Shriramana! My current *plan A* for LDC is: Prerequisite: Enable LLVM Cpp backend For release: Compile DDMD frontend to C++ and distribute D and C++ version of DDMD. Bootstrap process: - Create stage1 ldc compiler from C++ version of frontend. - Use stage1 ldc to compile stage2 ldc compiler from D version of frontend. - For verification it could be useful to create a stage3 ldc compiler using the stage2 compiler. Advantage is that you only need a C/C++ compiler for bootstrap. Drawback is compile time. I have not yet tested this approach. Therefore *plan B*: Use a previous version of LDC to compile the current version. This will work as long as the used language in the frontend is stable. The non-frontend parts of LDC might slowly migrate from C++ to D. The pain point here is that LDC makes use of the LLVM C++ API which is really superior to the C API. Regards, Kai
Jul 22 2015
parent "rsw0x" <anonymous anonymous.com> writes:
On Wednesday, 22 July 2015 at 15:11:58 UTC, Kai Nacke wrote:
 Use a previous version of LDC to compile the current version. 
 This will work as long as the used language in the frontend is 
 stable.
I have a feeling this is going to end up being an issue. Whatever D version ddmd is shipped with is going to need to be a LTS version.
Jul 22 2015