Difference between revisions of "Compilers"

From D Wiki
Jump to: navigation, search
(Comparison: Add some information about shared libraries. GDC information is complete, please enhance DMD/LDC information)
(Fill in more LDC platform info from http://wiki.dlang.org/LDC)
Line 48: Line 48:
 
|'''Platforms'''
 
|'''Platforms'''
 
|
 
|
 +
*Windows
 
*Linux
 
*Linux
*Mac
+
*OS X
 
*FreeBSD
 
*FreeBSD
*Win
 
 
|
 
|
 +
*Windows (alpha)
 
*Linux
 
*Linux
*Mac (untested)
+
*OS X (untested)
 
*FreeBSD (untested)
 
*FreeBSD (untested)
*Win (alpha)
 
 
|
 
|
 +
*Windows
 
*Linux
 
*Linux
*Mac
+
*OS X
 
*FreeBSD
 
*FreeBSD
*Win
+
*iOS (experimental)
 
|---
 
|---
 +
 
|'''Architectures'''
 
|'''Architectures'''
 
|
 
|
Line 68: Line 70:
 
* amd64
 
* amd64
 
|
 
|
 +
Complete (runtime / standard library) support:
 
* i386
 
* i386
 
* amd64
 
* amd64
Line 73: Line 76:
 
* armel
 
* armel
 
* armhf
 
* armhf
* no druntime or phobos, packages for gdc in [https://packages.debian.org/sid/gdc-5 debian]:
+
 
** alpha
+
Partial or bare-metal only support (packages for gdc in [https://packages.debian.org/sid/gdc-5 debian]):
** arm64 (aarch64)
+
* alpha
** hppa
+
* arm64 (aarch64)
** hurd-i386
+
* hppa
** kfreebsd-amd64
+
* hurd-i386
** kfreebsd-i386
+
* kfreebsd-amd64
** m68k
+
* kfreebsd-i386
** mips
+
* m68k
** mipsel
+
* mips
** ppc
+
* mipsel
** pcc64
+
* ppc
** ppc64el
+
* pcc64
** s390x
+
* ppc64el
** sparc64
+
* s390x
 +
* sparc64
 
|
 
|
 +
Complete (runtime / standard library) support:
 
* i386
 
* i386
 
* amd64
 
* amd64
 +
 +
Near-complete support:
 +
* arm64 (aarch64)
 
* ppc
 
* ppc
 
* ppc64
 
* ppc64
 +
* ppc64el
 +
* mips
 +
 +
Partial or bare-metal only support:
 +
* armel
 +
* armhf
 
|---
 
|---
 
|'''Distribution'''
 
|'''Distribution'''

Revision as of 12:54, 19 August 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
  • Windows
  • Linux
  • OS X
  • FreeBSD
  • Windows (alpha)
  • Linux
  • OS X (untested)
  • FreeBSD (untested)
  • Windows
  • Linux
  • OS X
  • FreeBSD
  • iOS (experimental)
Architectures
  • i386
  • amd64

Complete (runtime / standard library) support:

  • i386
  • amd64
  • x32
  • armel
  • armhf

Partial or bare-metal only support (packages for gdc in debian):

  • alpha
  • arm64 (aarch64)
  • hppa
  • hurd-i386
  • kfreebsd-amd64
  • kfreebsd-i386
  • m68k
  • mips
  • mipsel
  • ppc
  • pcc64
  • ppc64el
  • s390x
  • sparc64

Complete (runtime / standard library) support:

  • i386
  • amd64

Near-complete support:

  • arm64 (aarch64)
  • ppc
  • ppc64
  • ppc64el
  • mips

Partial or bare-metal only support:

  • armel
  • armhf
Distribution
  • Source
  • Multi-platform source/binary archive
  • Multi-platform installer (DVM)
  • Windows installer
  • OS X package (.dmg)
  • Debian/Ubuntu package (.deb)
  • Fedora package (.rpm)
  • OpenSUSE (.rpm) package
  • Debian/Ubuntu repository via http://d-apt.sourceforge.net
  • OS-X homebrew and macports repositories
  • Source
  • Windows / Linux binary archive
  • Debian/Ubuntu repository
  • Gentoo repository
  • Archlinux 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 (?)
Phobos as a shared library
  • Linux
  • Linux
Building D code as shared library
  • Linux
  • Windows ?
  • Linux
Dynamic loading of D shared libraries
  • Linux
  • Linux

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)
Cross-platform
  • DVM (Any version)
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.068.0)
  • Community (5.2.0)
  • Community (0.15.1)
Gentoo see https://wiki.gentoo.org/wiki/Dlang
FreeBSD