Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which D Compiler to Use?

I would like to try out D but I'm not quite sure what compiler to use for it. I have found some articles, and also SO questions, on the topic, but I did not find any up-to-date ones.

What are the benefits of each compiler, and what are the drawbacks? Right now the DMD compiler seems the best to me but I might just be misled by outdated information.

like image 217
Jeroen Avatar asked Aug 16 '13 22:08

Jeroen


People also ask

What compiler is D?

DMD is the reference compiler for the D programming language.

What C compiler should I use?

If you want to run C or C++ programs in your Windows operating system, then you need to have the right compilers. The MinGW compiler is a well known and widely used software for installing GCC and G++ compilers for the C and C++ programming languages.

Who uses D programming language?

D has been successfully used for AAA games, language interpreters, virtual machines, an operating system kernel, GPU programming, web development, numerical analysis, GUI applications, a passenger information system, machine learning, text processing, web and application servers and research.

Is Da compiled language?

A compiled language is a programming language where the source code is translated into machine code and the machine code is stored in a separate file. A compiled language tends to give the developer more control over hardware aspects like memory management and CPU usage.


1 Answers

All 3 of the main D compilers (dmd, gdc, ldc) use the same front-end, but dmd is generally a bit ahead of the others as it's the reference compiler. Also, I believe that there are a few cases where the other 2 don't implement some features yet (primarily on Windows or OS X IIRC), though in general, they work just fine. The primary advantage to gdc or ldc is that they generate faster code (though how much faster depends on the code). However, they also take much longer to compile code.

So, if you're just starting out, I'd suggest that you just use dmd and not worry about it. It's guaranteed to be the most up-to-date compiler, and I believe that it's what most people use. The primary downside to it is that the code that it generates isn't quite as fast, but you can look into the other compilers later if/when you really care about that.

For production code, the approach that I would generally take would be to develop using dmd and then generate the production code with either gdc or ldc. That way, you get the fast compilation times when developing code but still get the faster binaries in production.

like image 183
Jonathan M Davis Avatar answered Sep 23 '22 00:09

Jonathan M Davis