www.digitalmars.com         C & C++   DMDScript  

D.gnu - Is GDC a solid option versus LDC?

reply rempas <rempas tutanota.com> writes:
 From what I know, most people (if not all), seem to prefer LDC 
over GDC. When it comes to C, I always prefer GCC as GCC's 
backend compiles code faster and also produces code will run 
faster than LLVM (even if the differences are small). When it 
comes to D, GDC seems to compile code faster in my machine (AMD 
Ryzen 5 2400G) than LDC about 3-4 times faster!

However, I'm really skeptical as to why people seem to prefer LDC 
and I wonder if GDC is not as stable and reliable as LDC or if 
most code that uses recent code doesn't work in GDC. I have also 
heard that LDC get support for new things faster than GDC. Is 
that true? And if yes, then for how much difference are we 
talking about?

Any personal experiences would be much appreciated.
Mar 04 2022
next sibling parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 05/03/2022 4:05 AM, rempas wrote:
 However, I'm really skeptical as to why people seem to prefer LDC and I 
 wonder if GDC is not as stable and reliable as LDC or if most code that 
 uses recent code doesn't work in GDC. I have also heard that LDC get 
 support for new things faster than GDC. Is that true? And if yes, then 
 for how much difference are we talking about?
GDC has a few issues that LDC simply doesn't have. For instance GCC can only depend on a binary of the last version of GCC (my knowledge of that is what I've heard from Iain). What this means is its stuck using a frontend that is based upon a version that was still C++ and that is oldddddddd. Many years old. The version you are probably using was released back in 2017, more or less. Yes some patches have been back ported (2.076 is the version, but even that was D so they had to have been rewritten into C++). Right now GDC is close to getting the frontend written in D, which from what I hear should be next release. At which point it'll keep up.
Mar 04 2022
next sibling parent reply rempas <rempas tutanota.com> writes:
On Friday, 4 March 2022 at 15:17:49 UTC, rikki cattermole wrote:
 GDC has a few issues that LDC simply doesn't have.

 For instance GCC can only depend on a binary of the last 
 version of GCC (my knowledge of that is what I've heard from 
 Iain).

 What this means is its stuck using a frontend that is based 
 upon a version that was still C++ and that is oldddddddd. Many 
 years old.

 The version you are probably using was released back in 2017, 
 more or less. Yes some patches have been back ported (2.076 is 
 the version, but even that was D so they had to have been 
 rewritten into C++).

 Right now GDC is close to getting the frontend written in D, 
 which from what I hear should be next release. At which point 
 it'll keep up.
Oh, sucks to hear that. Can I get some more info (links?) on that one? Also do you know where is the current development source of GDC?
Mar 04 2022
parent reply Iain Buclaw <ibuclaw gdcproject.org> writes:
On Friday, 4 March 2022 at 15:31:30 UTC, rempas wrote:
 Oh, sucks to hear that. Can I get some more info (links?) on 
 Also do you know where is the current development source of GDC?
announcement: https://forum.dlang.org/post/nuphsvwkdlygdcxaihwf forum.dlang.org mainline: https://gcc.gnu.org/git.html gh-mirror: https://github.com/gcc-mirror/gcc/
Mar 04 2022
parent rempas <rempas tutanota.com> writes:
On Friday, 4 March 2022 at 15:59:33 UTC, Iain Buclaw wrote:
 announcement: 
 https://forum.dlang.org/post/nuphsvwkdlygdcxaihwf forum.dlang.org

 mainline: https://gcc.gnu.org/git.html
 gh-mirror: https://github.com/gcc-mirror/gcc/
Thanks a lot!
Mar 04 2022
prev sibling parent Iain Buclaw <ibuclaw gdcproject.org> writes:
On Friday, 4 March 2022 at 15:17:49 UTC, rikki cattermole wrote:
 On 05/03/2022 4:05 AM, rempas wrote:
 However, I'm really skeptical as to why people seem to prefer 
 LDC and I wonder if GDC is not as stable and reliable as LDC 
 or if most code that uses recent code doesn't work in GDC. I 
 have also heard that LDC get support for new things faster 
 than GDC. Is that true? And if yes, then for how much 
 difference are we talking about?
GDC has a few issues that LDC simply doesn't have. For instance GCC can only depend on a binary of the last version of GCC (my knowledge of that is what I've heard from Iain).
There's no strong dependency on GCC. What you probably mean is that there are gcc-specific options used when building the D front-end in GDC. However, I've successfully built GDC using DMD and LDC as the bootstrapping compiler, but that requires you to have a wrapper script that converts GCC-style options to their DMD or LDC equivalent.
 What this means is its stuck using a frontend that is based 
 upon a version that was still C++ and that is oldddddddd. Many 
 years old.
You mean, stable. GDC is stable. :-)
 Right now GDC is close to getting the frontend written in D, 
 which from what I hear should be next release. At which point 
 it'll keep up.
Correct, next release in a couple months will be the first self-hosted version, probably based on 2.100-beta (and 2.100.x when the release goes out).
Mar 04 2022
prev sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, Mar 04, 2022 at 03:05:36PM +0000, rempas via D.gnu wrote:
 From what I know, most people (if not all), seem to prefer LDC over
 GDC.  When it comes to C, I always prefer GCC as GCC's backend
 compiles code faster and also produces code will run faster than LLVM
 (even if the differences are small). When it comes to D, GDC seems to
 compile code faster in my machine (AMD Ryzen 5 2400G) than LDC about
 3-4 times faster!
 
 However, I'm really skeptical as to why people seem to prefer LDC and
 I wonder if GDC is not as stable and reliable as LDC or if most code
 that uses recent code doesn't work in GDC. I have also heard that LDC
 get support for new things faster than GDC. Is that true? And if yes,
 then for how much difference are we talking about?
[...] Both GDC and LDC are good compilers. I wouldn't hesitate to use either if performance is important in what I'm doing. The only difference is that GDC, being a part of the GCC project, is tied to the GCC release cycle, so it tends to lag behind DMD and LDC in terms of the latest language developments. LDC releases on its own schedule, and as of a year or two ago, has been closely tracking DMD releases, so it is very up-to-date in terms of language development. Being practically on par with DMD means that I can easily switch between DMD and LDC latest releases without having to worry about my code being incompatible with either. (Though generally that doesn't really happen that much, and hardly at all if you aren't always keeping tabs on the latest language developments.) If your code isn't reliant on the bleeding edge, though, GDC is definitely not inferior to LDC in any way. T -- It's bad luck to be superstitious. -- YHL
Mar 04 2022
parent reply rempas <rempas tutanota.com> writes:
On Friday, 4 March 2022 at 15:26:38 UTC, H. S. Teoh wrote:
 Both GDC and LDC are good compilers. I wouldn't hesitate to use 
 either if performance is important in what I'm doing.

 The only difference is that GDC, being a part of the GCC 
 project, is tied to the GCC release cycle, so it tends to lag 
 behind DMD and LDC in terms of the latest language 
 developments.  LDC releases on its own schedule, and as of a 
 year or two ago, has been closely tracking DMD releases, so it 
 is very up-to-date in terms of language development. Being 
 practically on par with DMD means that I can easily switch 
 between DMD and LDC latest releases without having to worry 
 about my code being incompatible with either.  (Though 
 generally that doesn't really happen that much, and hardly at 
 all if you aren't always keeping tabs on the latest language 
 developments.)

 If your code isn't reliant on the bleeding edge, though, GDC is 
 definitely not inferior to LDC in any way.


 T
Thank you! I was wondering, Is staying so much up to date really impossible here? Other than ImportC (which will still be completed at some point), D has already support for 1 million features already so will this be a big problem? I see this becoming a smaller problem with each release.
Mar 04 2022
parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, Mar 04, 2022 at 03:52:10PM +0000, rempas via D.gnu wrote:
 On Friday, 4 March 2022 at 15:26:38 UTC, H. S. Teoh wrote:
[...]
 The only difference is that GDC, being a part of the GCC project, is
 tied to the GCC release cycle, so it tends to lag behind DMD and LDC
 in terms of the latest language developments.
[...]
 Thank you! I was wondering, Is staying so much up to date really
 impossible here? Other than ImportC (which will still be completed at
 some point), D has already support for 1 million features already so
 will this be a big problem? I see this becoming a smaller problem with
 each release.
As I said, if you're not relying on the latest-and-greatest bleeding edge, GDC is a perfectly fine compiler. Iain has already said the next release will be self-hosting, so we can finally move on from the ancient C++-based compiler to the latest self-hosted one. Once that's done, GDC should keep up with language developments at a much better pace than before. T -- People say I'm indecisive, but I'm not sure about that. -- YHL, CONLANG
Mar 04 2022
parent rempas <rempas tutanota.com> writes:
On Friday, 4 March 2022 at 17:13:23 UTC, H. S. Teoh wrote:
 As I said, if you're not relying on the latest-and-greatest 
 bleeding edge, GDC is a perfectly fine compiler. Iain has 
 already said the next release will be self-hosting, so we can 
 finally move on from the ancient C++-based compiler to the 
 latest self-hosted one. Once that's done, GDC should keep up 
 with language developments at a much better pace than before.


 T
Thank you! I do rely in a small D subset so I will be fine. Have an amazing day ;)
Mar 06 2022