Recently, I start to use dlang in competitive programming. There are 3 dlang compiler, "DMD", "LDC", "GDC".
In competitive programming, best choice is "LDC", but in many online judge, we can use only "DMD" or "GDC".
I hope to many online judge install "LDC", so I write this blog.
Compiler compare
- DMD : Official compiler. Can use latest language version. Moderate Fast.
- LDC : based on llvm. Moderate new. Very Fast.
- GDC : based on gcc. Not new, Moderate Fast.
How to install ldc
- Go to github's release page https://github.com/ldc-developers/ldc/releases
- Download ldc(If you use 64bit-linux,
ldc2-1.2.0-linux-x86_64.tar.xz
, in now) - Extract
- ADD
/your/download/path/ldc2-1.2.0-linux-x86_64/bin
to $PATH.
How to use ldc
Debug mode :
ldc2 A.d
Release mode(and optimize) :
ldc2 -O -release A.d