DMD vs GDC vs LDC

What are the advantages / disadvantages of various D compilers? How is performance and standard D2 compatibility / support? How well are debuggers supported? How good are error messages and IDE integration? How good is 64 bit support? My thought so far:

DMD

  • Mature and well groomed
  • Only one platform, 64 bit support is not good.
  • Not foss

Gdc

  • Support for various platforms
  • Has very mature optimizations, why fast?
  • Deprecated runtime
  • GCC - good debugger support?

LDC

  • Support for various platforms
  • LLVM, why does it support JITing?
  • Has very mature optimizations, why fast?
  • Not well supported?
  • Deprecated runtime

dead / not working

  • Dang
  • Sdc
  • MiniD - very, very nice, but not D (never claimed to be, though)

I think about targeting on ARM, and I think GDC is a tool of choice, but I'm not sure.

+50
compiler-construction d dmd gdc
Jul 20 '11 at 19:00
source share
3 answers

DMD is a reference implementation. Only the backend is proprietary, the interface is open source.
The quality of code generation is not so overwhelming. However, x64 support is only a few months away.

GDC and LDC are both based on the DMD interface, so it may take some time until a new version of the interface is merged.
Because the backend that they use is very mature and good, the quality of these compilers depends largely on the glue code that connects the interface and the backend.

LDC and GDC are still actively developing, but mostly just a few guys.
In general, they could use some labor.

+21
Jul 20 2018-11-21T00:
source share
  • A significant drawback of DMD is the lack of a shared library:
  • I personally was surprised that the GDC supports D2, but they say that it does :
    • D1: 1.067
    • D2: 2.053

  • LDC is definitely almost not supported: "D2 only works with x86-32 Linux . " For me, this is a show problem.

  • When searching for LDC, I found another compiler (?!): Dil . I have not tested it yet, but at least it is currently supported. I will explore more on this subject as soon as possible. EDIT: As noted in the comments, dil is not yet close to a somewhat complete state - it can only analyze the code and generate documentation from sources.
+7
Jul 21 '11 at 9:40
source share

As of February 2012, it seems that the LDC is not really a useful option (at least on Debian).

For example, consider the first program in book D :

 import std.stdio; void main(string[] args) { writeln("Hello, world!"); } 

This does not compile with LDC on my system:

 hello.d(24): Error: module stdio cannot read file 'std/stdio.d' 

The same applies to the first program on dlang.org :

 import std.stdio; void main() { ulong lines = 0; double sumLength = 0; foreach (line; stdin.byLine()) { ++lines; sumLength += line.length; } writeln("Average line length: ", lines ? sumLength / lines : 0); } 

This is because my LDC does not support Phobos - the current D time library . It seems like you can create a version of LDC, including Phobos, but that's not how it ships to Debian at least.

GDC, and, of course, DMD, how to compile above is excellent. It seems that the GDC is pretty up-to-date (DMD was released 2.057 two months ago, and GDC is supporting it now).

For me, the GDC was an obvious choice, because the simple " apt-get -V install gdc " brought both the compiler and the runtime Phobos without problems (tested on Debian unstable).

+3
Feb 25 2018-12-12T00:
source share



All Articles