D : dmd vs gdc : which one to choose?

Sebastien Alaiwan via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 19 22:36:51 PST 2015


On Thursday, 19 February 2015 at 08:46:11 UTC, Mayuresh Kathe 
wrote:
> Should I choose DMD or go with GDC?

I work with projects whose code is half written in C, half 
written in D. I use GNU make to build them. I found out that 
using GDC was a much better choice for several reasons:

- project portability 1: under Windows, dmd generates OMF object 
files that can't be linked by the gcc linker, while gdc generates 
COFF objet files. Which means:
    - I can use the same Makefile regardless of the target OS.
    - I can link mingw-compiled C code with D code.
    - I avoid the struggle of finding OMF versions of "SDL.lib", 
"advapi32.lib", etc.

- project portability 2: stupid detail, but the weird dmd way of 
specifying the output file in the command line ( "dmd 
-ofmyfile.o" ) defeats the heuristics of MSYS2 path conversion. 
That's a dealbreaker for me.

- when I'm running Debian/Ubuntu, the simple ability to natively 
run "apt-get install gdc" to install/upgrade is very practical.

As dmd's compilation speed is blazingly fast, it remains a cool 
way of writing automation scripts (#!/bin/usr/env rdmd), much 
better, in my opinion, than Bash, or even Python.



More information about the Digitalmars-d-learn mailing list