Thread overview
What about GDC and LDC after DMD becomes D?
Jul 22, 2015
Shriramana Sharma
Jul 22, 2015
cym13
Jul 22, 2015
Xinok
Jul 22, 2015
rsw0x
Jul 22, 2015
Daniel Kozák
Jul 22, 2015
Kai Nacke
Jul 22, 2015
rsw0x
July 22, 2015
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 ஶ்ரீரமணஶர்மா श्रीरमणशर्मा

July 22, 2015
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++.
July 22, 2015
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.
July 22, 2015
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.
July 22, 2015
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
July 22, 2015
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
July 22, 2015
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.