ddmdldc

Which compiler to use when learning D?


I'm interested in learning D. However I'm a bit turned of by the DMD, because it is not fully opensource. This is why I am considering using the LDC, but I'm not sure what's it's status. In the debian package it says:

Version: 1:0.14.0.dfsg-1     
LDC already compiles a lot of D code, but should still be considered beta quality. Take a look at the
     tickets to get a better impression on what still needs to be implemented. 

I know Debian repositories can sometimes be a bit ancient, but 1.0.0 seems to be the latest LDC release.

I intend do use libraries written in C a lot. Which compiler will fit this purpose better? LDC or DMD? I know this question has been asked before, but all the questions I found are rather old and I want to know the current status.


Solution

  • I'm interested in learning D. However I'm a bit turned of by the DMD, because it is not fully opensource.

    edit: since April 8th 2017 DMD is fully OpenSource.


    This is just a licensing about the backend. The entire development happens on Github: https://github.com/dlang/dmd

    My recommendation is to use DMD as it has the fastest compile-time which is quite helpful when learning a language (seriously it's blazingly fast!). On Linux you can easily install DMD - even just as a user - with the install script:

    curl https://dlang.org/install.sh | bash -s dmd
    

    (see the downloads page for more instructions and download options.)

    Last but not least there are a couple of nice tools like rdmd (it allows a script-like execution of DMD source files) that you should familiarize yourself with, because they can save you a lot of time & make programming in D even more fun!

    This is why I am considering using the LDC, but I'm not sure what's it's status. In the debian package it says: I know Debian repositories can sometimes be a bit ancient, but 1.0.0 seems to be the latest LDC release.

    "A bit ancient" is an understatement ;-)
    In case you want to go with LDC, you should definitively grab a more recent release. As of now 1.0.0 is the latest release, but 1.1.0 will be released very soon (the second beta is already out). You can also grab the latest LDC with the install script:

    curl https://dlang.org/install.sh | bash -s ldc