gcc 9 vs. dmd?
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Fri Nov 30 11:35:55 UTC 2018
On Friday, November 30, 2018 2:43:41 AM MST welkam via Digitalmars-d-learn
wrote:
> On Friday, 30 November 2018 at 04:47:26 UTC, Andrew Pennebaker
>
> wrote:
> > gcc is currently required for dmd on FreeBSD, as dmd links to
> > libstdc++.
>
> Parts of dmd are still written in C++ but most of it was
> converted recently. More on that here:
> "DMD backend now in D"
> https://forum.dlang.org/thread/psaekt$tah$1@digitalmars.com
That and the C/C++ compiler could be clang rather than gcc. Even without the
backend being ported to D, there shouldn't be an actual dependency on gcc
specifically (especially on FreeBSD where you may not even have gcc
installed). But if I understand correctly, dmd has always used the C
compiler to link on *nix systems rather than using the linker directly. I
don't know why it does, but linking via the C compiler is a completely
different issue from integrating with it.
Regardless, as to the OP's question about gcc integration, that really
doesn't have much to do with dmd. That's a big step forward for gdc, but dmd
is the reference compiler. It's where everything is implemented. gdc and ldc
are then alternate compilers that use the same front-end. but they're
separate projects, and there's really no benefit to us at this point to
removing dmd in favor of either of the other two. With dmd, we're in full
control of the code and the release cycle, which is not true with llvm or
gcc. Honestly, as great as it is for gdc to end up in the official gcc
release, in practice, I expect that it's going to be a recipe for a portion
of the community using an outdated version of the language (especially when
coupled with stuff like LTS releases for Linux distros). That's already been
a problem with gdc even without it being in the official gcc release due to
how long it's taken them to catch up after the front-end was converted to D.
Also, dmd's backend is the backend that Walter wrote and has used for
decades - and it's part of dmc, which he still sells. So, I don't think that
he's going to be in hurry to drop it. And if he were, I honestly expect that
ldc would have become the reference compiler a while ago, not gdc. But dmd
continues to be the reference compiler, and while improving its backend is
not the focus, Walter still does work on it (and part of the reason that
he's converted it to D is so that he can more easily improve it).
Historically, Walter has wanted to stay away from gcc and clang code (or the
code of any other compiler that isn't his), because in the past, he's found
that being able to say that he's never read the source code has been a good
defense against any kind of accusation of code stealing (which definitely
matters when he's selling a C++ compiler). So, all the signs are that we're
going to continue to have the choice of dmd, ldc, and gdc, and none of them
are going anywhere.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list