Is GDC a solid option versus LDC?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Mar 4 15:26:38 UTC 2022


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


More information about the D.gnu mailing list