Difference between revisions of "Compilers"
m (Stupid D Compiler is now the Snazzy D Compiler) |
(→Comparison: Modernize, mainly wrt. LDC, and shared-libraries support) |
||
(One intermediate revision by one other user not shown) | |||
Line 56: | Line 56: | ||
*Windows | *Windows | ||
*Linux | *Linux | ||
− | *OS X | + | *OS X (incl. iOS etc.) |
*FreeBSD | *FreeBSD | ||
− | |||
− | |||
*Android | *Android | ||
|--- | |--- | ||
Line 67: | Line 65: | ||
* i386 | * i386 | ||
* amd64 | * amd64 | ||
+ | * arm64(aarch64)(experimental) | ||
| | | | ||
Complete (runtime / standard library) support: | Complete (runtime / standard library) support: | ||
Line 94: | Line 93: | ||
* i386 | * i386 | ||
* amd64 | * amd64 | ||
− | * armel | + | * arm64 (aarch64) |
− | * armhf | + | * armel (untested) |
+ | * armhf (untested) | ||
Near-complete support: | Near-complete support: | ||
− | |||
* ppc | * ppc | ||
* ppc64 | * ppc64 | ||
* ppc64el | * ppc64el | ||
* mips64 | * mips64 | ||
+ | * riscv64 | ||
+ | * loongarch64 | ||
Partial or bare-metal only support: | Partial or bare-metal only support: | ||
* mips | * mips | ||
* s390x | * s390x | ||
+ | * WebAssembly | ||
|--- | |--- | ||
|'''Distribution''' | |'''Distribution''' | ||
Line 129: | Line 131: | ||
| | | | ||
*Source | *Source | ||
− | *Windows / Linux / OS X binary archive | + | *Windows / Linux / OS X / FreeBSD / Android binary archive |
*Debian/Ubuntu repository | *Debian/Ubuntu repository | ||
*Fedora repository | *Fedora repository | ||
Line 165: | Line 167: | ||
| | | | ||
* Linux | * Linux | ||
− | * FreeBSD | + | * FreeBSD |
| | | | ||
* Linux | * Linux | ||
− | * FreeBSD | + | * FreeBSD |
| | | | ||
− | * Linux | + | * Linux (incl. Android) |
+ | * OS X | ||
+ | * FreeBSD | ||
+ | * Windows | ||
|--- | |--- | ||
|'''Building D code as shared library''' | |'''Building D code as shared library''' | ||
| | | | ||
* Linux | * Linux | ||
− | * FreeBSD | + | * OS X |
− | * Windows | + | * FreeBSD |
+ | * Windows | ||
| | | | ||
| | | | ||
− | * Linux | + | * Linux (incl. Android) |
* OS X | * OS X | ||
+ | * FreeBSD | ||
+ | * Windows | ||
|--- | |--- | ||
|'''Dynamic loading of D shared libraries''' | |'''Dynamic loading of D shared libraries''' | ||
| | | | ||
* Linux | * Linux | ||
+ | * FreeBSD | ||
| | | | ||
| | | | ||
− | * Linux | + | * Linux (incl. Android) |
* OS X | * OS X | ||
+ | * FreeBSD | ||
+ | * Windows | ||
|--- | |--- | ||
!colspan="4" align="center"|<br/>'''Linux specific''' | !colspan="4" align="center"|<br/>'''Linux specific''' | ||
Line 207: | Line 218: | ||
|--- | |--- | ||
|'''Object file format''' | |'''Object file format''' | ||
− | | | + | | COFF |
| COFF | | COFF | ||
| COFF | | COFF |
Latest revision as of 18:53, 25 January 2025
DMD »Digital Mars D compiler |
GDC »GCC D compiler |
LDC »LLVM D compiler |
Which compiler should I use?
For beginners, DMD is the recommended choice, as it is the implementation closest to the D Language Specification. Otherwise, the best choice depends on the project's needs, the target platforms, and personal preferences. GDC and LDC both generate substantially faster binaries than DMD.
Comparison
DMD | GDC | LDC | |
---|---|---|---|
Platforms |
|
|
|
Architectures |
|
Complete (runtime / standard library) support:
Partial or bare-metal only support (packages for gdc in debian):
|
Complete (runtime / standard library) support:
Near-complete support:
Partial or bare-metal only support:
|
Distribution |
|
|
|
Backend | DMD (DMC fork) | GCC | LLVM |
License | Boost | GPL 3 or later | LDC-specific code: 3-clause BSD |
Inline assembler |
|
|
|
SIMD | Partial (?) | Partial (?) | Partial (?) |
Phobos as a shared library |
|
|
|
Building D code as shared library |
|
| |
Dynamic loading of D shared libraries |
|
| |
Linux specific | |||
Object file format | ELF | ELF | ELF |
Mac specific | |||
Object file format | Mach-O | Mach-O | Mach-O |
Windows specific | |||
Object file format | COFF | COFF | COFF |
Package and/or binary availability, by platform and compiler
Some unofficial repositories and downloads are listed here, but of course many more do exist. With a little searching, you may be able to find something more up to date for your chosen OS.
Very old compilers are (mostly) omitted, as they are unlikely to be of interest to users.
Platform |
Compiler | ||
---|---|---|---|
DMD | GDC | LDC | |
Windows | |||
OS X | |||
iOS | |||
Android |
| ||
Linux (generic) |
| ||
Cross-platform |
|
||
Distribution-specific packages | |||
Debian | |||
Ubuntu | |||
Fedora | |||
OpenSuse | |||
CentOS | |||
Arch Linux |
|
|
|
Gentoo | see https://wiki.gentoo.org/wiki/Dlang | ||
FreeBSD |
|
Experimental compilers and forks
- SDC (Snazzy D Compiler) - from-scratch D compiler implementation, written in idiomatic D.
- LDC for iOS - LDC-based toolkit for cross-compiling to iOS
- D for Android - Toolkit for cross-compiling to Android (x86 using DMD and ARM using LDC)
- Calypso - LDC fork which provides direct Clang interoperability, allowing the use of C headers directly.
- DCompute (LDC CUDA and SPIRV) - Library and LDC fork to "target CUDA and SPIR to enable hassle free native execution on the gpu" -upstreamed into LDC
- MicroD - DMD fork which outputs C source code instead of object files
- dtojs - DMD fork which outputs JavaScript source code instead of object files
- DIL - D compiler written in D2/Tango (inactive project)
- dscripten - LDC/emscripten-based toolchain for compiling D to asm.js / WebAssembly
Category page: Experimental compilers