Difference between revisions of "Compilers"

From D Wiki
Jump to: navigation, search
(Undo revision 6010 by J Colvin (talk))
Line 36: Line 36:
 
== Comparison ==
 
== Comparison ==
  
{| class="wikitable" style="width: 45em"
+
{| class="wikitable" style="width: 65em"
 
!
 
!
 
!DMD
 
!DMD
Line 118: Line 118:
 
| COFF
 
| COFF
 
| COFF
 
| COFF
 +
|}
 +
 +
==Package and/or binary availability, by platform and compiler==
 +
 +
Version number is given in brackets. Many of the manual download links have 10s of versions available, only the most recent few are listed here.
 +
 +
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.
 +
 +
{| class="wikitable" style="width: 65em"
 +
!rowspan="2"|<br/>Platform
 +
!colspan="3" align="center"|Compiler
 +
|---
 +
!DMD
 +
!GDC
 +
!LDC
 +
|---
 +
!Windows
 +
|
 +
*[http://dlang.org/download.html Manual download] (2.067.1)
 +
*[https://chocolatey.org Chocolatey] (2.066.1, 2.067.0 available awaiting moderation)
 +
|
 +
*[http://gdcproject.org/downloads Manual download] (4.9.2)
 +
|
 +
*[https://github.com/ldc-developers/ldc/releases Manual download] (0.15.1, 0.15.2-beta1)
 +
|---
 +
!OS X
 +
|
 +
*[http://brew.sh Homebrew] (2.067.1)
 +
*[https://www.macports.org MacPorts] (2.067.0)
 +
*[http://dlang.org/download.html Manual download] (2.067.1)
 +
|
 +
|
 +
*[http://brew.sh Homebrew] (0.15.1, 0.15.2-beta1)
 +
*[https://github.com/ldc-developers/ldc/releases Manual download] (0.15.1, 0.15.2-beta1)
 +
|---
 +
!Linux (generic)
 +
|
 +
*[http://dlang.org/download.html Manual download] (2.067.1)
 +
|
 +
*[http://gdcproject.org/downloads Manual download] (4.9.2)
 +
|
 +
*[https://github.com/ldc-developers/ldc/releases Manual download] (0.15.1, 0.15.2-beta1)
 +
|---
 +
!colspan="4" | Distribution-specific packages
 +
|---
 +
!Debian
 +
|
 +
*[http://dlang.org/download.html Manual download] (2.067.1)
 +
*[http://d-apt.sourceforge.net APT repository] (2.067.1)
 +
|
 +
*Stable/Testing (4.8.4, 4.9.2)
 +
*Unstable (4.8.4, 4.9.2, 5.1.1)
 +
*Experimental (5.x.x)
 +
|
 +
*Stable/Testing/Unstable (0.14.0)
 +
*Experimental (0.15.1)
 +
|---
 +
!Ubuntu
 +
|
 +
*[http://dlang.org/download.html Manual download] (2.067.1)
 +
*[http://d-apt.sourceforge.net APT repository] (2.067.1)
 +
|
 +
*14.04 (4.8.2)
 +
*14.10 (4.8.3, 4.9.1)
 +
*15.04 (4.8.4, 4.9.2)
 +
|
 +
*14.10 (0.14.0)
 +
|---
 +
!Fedora
 +
|
 +
*[http://dlang.org/download.html Manual download] (2.067.1)
 +
*20/21 [https://build.opensuse.org/package/show?project=home%3Azhonghuaren&package=dmd Unofficial repository] (2.066.1)
 +
|
 +
|
 +
*20 (between 0.13.0-alpha1 and 0.13.0-alpha2)
 +
*21 (0.13.0)
 +
*22 (0.15.1)
 +
*Rawhide (0.15.2-beta1)
 +
|---
 +
!OpenSuse
 +
|
 +
*[https://build.opensuse.org/project/show/devel:languages:D devel:languages:D] (2.066.1)
 +
*[https://build.opensuse.org/project/show/home:marc_schuetz:branches:devel:languages:D home:marc_schuetz] (2.067.0)
 +
|
 +
|
 +
*[https://build.opensuse.org/project/show/devel:languages:D devel:languages:D] (0.15.1)
 +
*[https://build.opensuse.org/project/show/home:marc_schuetz:branches:devel:languages:D home:marc_schuetz] (0.15.2-beta1)
 +
|---
 +
!CentOS
 +
|
 +
*[http://dlang.org/download.html Manual download] (2.067.1)
 +
|
 +
|
 +
|---
 +
!Arch Linux
 +
|
 +
*Community (2.067.1)
 +
|
 +
*Community (4.9.2)
 +
|
 +
*Community (0.15.1)
 +
|---
 +
!Gentoo
 +
|colspan="3" align=center | see https://wiki.gentoo.org/wiki/Dlang
 +
|---
 +
!FreeBSD
 +
|
 +
*[http://dlang.org/download.html Manual download] (2.067.1)
 +
*Ports (2.067.0)
 +
|
 +
|
 
|}
 
|}

Revision as of 11:19, 11 May 2015

Compilers: OverviewDMDGDCLDC

DMD »

Digital Mars D compiler
The formal D compiler.

GDC »

GCC D compiler
Fast and open source.

LDC »

LLVM D compiler
Fast and open source.


Also see: Experimental compilers


Which compiler should I use?

If you're a beginner DMD is the recommended choice, as it is the implementation closest to the D Language Specification. Otherwise it depends on what you need, what platforms you intend to develop for, and your personal preferences. GDC and LDC both generate substantially faster binaries than DMD.

Comparison

DMD GDC LDC
Platforms
  • Linux
  • Mac
  • FreeBSD
  • Win
  • Linux
  • Mac
  • FreeBSD
  • Win
  • Linux
  • Mac
  • FreeBSD
  • Win
Architectures
  • i386
  • amd64
  • i386
  • amd64
  • i386
  • amd64
  • ppc
  • ppc64
Distribution Source, multi-platform source/binary archive, Windows installer, packages for OS X (.dmg), Debian/Ubuntu (.deb), Fedora (.rpm), OpenSUSE (.rpm), Debian/Ubuntu repository via http://d-apt.sourceforge.net, OS-X homebrew and macports repositories. Source, Windows binary archive, Debian/Ubuntu repository Source, Linux / OS X binary archive, Debian/Ubuntu repository, Fedora repository, Gentoo repository
Backend DMD (DMC fork) GCC LLVM
License Frontend: GPL 1 or later / Artistic License

Backend: custom

GPL 3 or later LDC-specific code: 3-clause BSD
Inline assembler Yes, x86 Yes, GCC-style only (all targets) Yes, D-style (x86) and GCC-style (all targets)
SIMD Partial (?) Partial (?) Partial (?)

Linux specific
Object file format ELF ELF ELF

Mac specific
Object file format Mach-O Mach-O Mach-O

Windows specific
Object file format OMF (32) / COFF (64) COFF COFF

Package and/or binary availability, by platform and compiler

Version number is given in brackets. Many of the manual download links have 10s of versions available, only the most recent few are listed here.

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
Linux (generic)
Distribution-specific packages
Debian
  • Stable/Testing (4.8.4, 4.9.2)
  • Unstable (4.8.4, 4.9.2, 5.1.1)
  • Experimental (5.x.x)
  • Stable/Testing/Unstable (0.14.0)
  • Experimental (0.15.1)
Ubuntu
  • 14.04 (4.8.2)
  • 14.10 (4.8.3, 4.9.1)
  • 15.04 (4.8.4, 4.9.2)
  • 14.10 (0.14.0)
Fedora
  • 20 (between 0.13.0-alpha1 and 0.13.0-alpha2)
  • 21 (0.13.0)
  • 22 (0.15.1)
  • Rawhide (0.15.2-beta1)
OpenSuse
CentOS
Arch Linux
  • Community (2.067.1)
  • Community (4.9.2)
  • Community (0.15.1)
Gentoo see https://wiki.gentoo.org/wiki/Dlang
FreeBSD