← Back to context

Comment by WalterBright

2 years ago

The DLang has 3 compilers:

1. gdc - based on the Gnu compiler collection back end

2. ldc - based on the LLVM back end

3. dmd - based on the x86 code generator that I wrote for Zortech/Symantec/Digital Mars

They each have their pluses, minuses, and targets. But the D language each supports is the same.

Overall, our users like the choice. Some even use more than one.

Ah, the obligatory comment from Walter Bright talking about D in posts about Zig

(Nothing wrong with it, just a bit funny how predictable it has become)

I guess the interesting difference in approach here, is that D seems to have completely separate compilers, while it looks like the main Zig compiler will support LLVM as a backend if you have it installed? If true, I like the approach Zig is going for.

  • yesterday on a thread on DMD somebody quipped "Funny how WalterBright seems to comment in every single HN thread other than this one..." and I thought it was hyperbole. Next HN thread I open, I'm proven wrong

That's cool. Another language with multiple compilers is Common Lisp, which has a dozen or so production-ready compilers (some commercial, but most free).

That allows people to use the fastest compiler during development, and the fastest runtime (or smallest memory footprint) compiler for the final release, which is really useful.

Also, just having a language specification which all compilers adhere to ensures that the language is stable and won't just break things under you (for better or worse, there are advantages for languages like Zig that can still change anything they want in order to make the language more consistent/cleaner/more powerful). I tend to value this stability a lot more these days - it lets me put all my effort in creating real value for users instead of constantly keeping up with development tools.

Having the choice for advanced users is a plus but I think having to choose is a big negative.

  • Ironically, when there was only one choice that was described as a big negative. Our experience with the troika has been a clear positive.

    • 15 years later it's negative. The user experience of having to download and switch compilers (or even think about it at all) is terrible, especially given that (after performance) one of the main motivators of switching to ldc (i.e. all serious use of D to make money) is either a bug or lack of platform support in dmd.

  • Most importantly it results in a significantly increased workload for the maintainers, and spreads out effort over a bigger area. So the most likely outcome is a language with multiple mediocre compilers, instead of one really good one that everyone works on.

    Which is the exact opposite of what the intention behind this proposal is, which is to make the language more maintainable.

    • LDC and GDC are both very good compilers.

      Technologically D suffers more from having a single frontend implementation than having multiple backends.

>Overall, our users like the choice.

All 10 of them? I mean, if Zig's target is eventual wide adoption, DLang is not a good precedent to model upon.