Difference between revisions of "Compilers"

From D Wiki
Jump to: navigation, search
m (Package and/or binary availability, by platform and compiler: update Arch Linux version)
(Package and/or binary availability, by platform and compiler: removed outdated package versions)
Line 208: Line 208:
 
==Package and/or binary availability, by platform and compiler==
 
==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.
+
<div style="background:#ffd; padding: 0.5ex 0.5ex;">
 +
<span style="font-size: 1.4em; color: #ca4;">&#9888;</span> This list had outdated information about package version - thus version information has been removed. Please check the most recent available package yourself on the linked pages.
 +
</div>
 +
 
  
 
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.
 
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.
Line 225: Line 228:
 
|
 
|
 
*[http://dlang.org/download.html Manual download]
 
*[http://dlang.org/download.html Manual download]
*[https://chocolatey.org Chocolatey] (2.067.0, 2.068.1 available awaiting moderation)
+
*[https://chocolatey.org Chocolatey]
 
|
 
|
*[http://gdcproject.org/downloads Manual download] (5.2.0 w/ dmd frontend 2.066.1)
+
*[http://gdcproject.org/downloads Manual download]
 
|
 
|
 
*[https://github.com/ldc-developers/ldc/releases Manual download]
 
*[https://github.com/ldc-developers/ldc/releases Manual download]
Line 234: Line 237:
 
|
 
|
 
*[http://brew.sh Homebrew]
 
*[http://brew.sh Homebrew]
*[https://www.macports.org MacPorts] (2.068.0)
+
*[https://www.macports.org MacPorts]
 
*[http://dlang.org/download.html Manual download]
 
*[http://dlang.org/download.html Manual download]
 
|
 
|
Line 245: Line 248:
 
|
 
|
 
|
 
|
*[https://github.com/smolt/ldc-iphone-dev/releases Manual download] (0.17.0-alpha1 experimental)
+
*[https://github.com/smolt/ldc-iphone-dev/releases Manual download]
 
|---
 
|---
 
!Android
 
!Android
 
|
 
|
*[[Build DMD for Android|Source]] (2.070 git master)
+
*[[Build DMD for Android|Source]]
 
|
 
|
 
|
 
|
*[https://github.com/joakim-noah/android/releases Manual download] (beta)
+
*[https://github.com/joakim-noah/android/releases Manual download]
 
*[[Build LDC for Android|Source]]
 
*[[Build LDC for Android|Source]]
 
|---
 
|---
Line 259: Line 262:
 
*[http://dlang.org/download.html Manual download]
 
*[http://dlang.org/download.html Manual download]
 
|
 
|
*[http://gdcproject.org/downloads Manual download] (5.2.0 w/ dmd frontend 2.066.1)
+
*[http://gdcproject.org/downloads Manual download]
 
|
 
|
 
*[https://github.com/ldc-developers/ldc/releases Manual download]
 
*[https://github.com/ldc-developers/ldc/releases Manual download]
Line 275: Line 278:
 
|
 
|
 
*[http://dlang.org/download.html Manual download]
 
*[http://dlang.org/download.html Manual download]
*[http://d-apt.sourceforge.net APT repository] (2.068.0)
+
*[http://d-apt.sourceforge.net APT repository]
 
|
 
|
*Stable ([https://packages.debian.org/jessie/gdc-4.8 4.8.4], [https://packages.debian.org/jessie/gdc-4.9 4.9.2])
+
* [https://packages.debian.org/jessie/gdc stable]
*Testing (([https://packages.debian.org/stretch/gdc-4.8 4.8.5], [https://packages.debian.org/stretch/gdc-4.9 4.9.3], [https://packages.debian.org/stretch/gdc-5 5.2.1]))
+
* [https://packages.debian.org/stretch/gdc testing]
*Unstable ([https://packages.debian.org/sid/gdc-4.8 4.8.5], [https://packages.debian.org/sid/gdc-4.9 4.9.3], [https://packages.debian.org/sid/gdc-5 5.2.1])
+
* [https://packages.debian.org/sid/gdc unstable]
 
|
 
|
*Stable/Testing/Unstable (0.14.0)
+
* [https://packages.debian.org/jessie/ldc stable]
*Experimental (0.15.1)
+
* [https://packages.debian.org/sid/ldc unstable]
 
|---
 
|---
 
!Ubuntu
 
!Ubuntu
 
|
 
|
 
*[http://dlang.org/download.html Manual download]
 
*[http://dlang.org/download.html Manual download]
*[http://d-apt.sourceforge.net APT repository] (2.068.0)
+
*[http://d-apt.sourceforge.net APT repository]
 
|
 
|
*14.04 ([http://packages.ubuntu.com/trusty-updates/gdc-4.8 4.8.4])
+
[http://packages.ubuntu.com/search?keywords=ldc gdc]
*15.04 ([http://packages.ubuntu.com/vivid/gdc-4.8 4.8.4], [http://packages.ubuntu.com/vivid/gdc-4.9 4.9.2])
 
*15.10 ([http://packages.ubuntu.com/wily/gdc-4.8 4.8.5], [http://packages.ubuntu.com/wily/gdc-4.9 4.9.3], [http://packages.ubuntu.com/wily/gdc-5 5.2.1])
 
 
|
 
|
*15.04 ([http://packages.ubuntu.com/vivid/ldc 0.14.0])
+
[http://packages.ubuntu.com/search?keywords=ldc ldc]
*15.10 ([http://packages.ubuntu.com/wily/ldc 0.14.0])
 
 
|---
 
|---
 
!Fedora
 
!Fedora
Line 302: Line 302:
 
|
 
|
 
See https://apps.fedoraproject.org/packages/ldc
 
See https://apps.fedoraproject.org/packages/ldc
*21 (0.13.0)
 
*22 (0.15.1)
 
*23 (0.15.2.beta1)
 
*Rawhide (0.16.0.alpha3)
 
 
|---
 
|---
 
!OpenSuse
 
!OpenSuse
 
|
 
|
*[https://build.opensuse.org/package/show/devel:languages:D/dmd devel:languages:D] (2.068.2)
+
*[https://build.opensuse.org/package/show/devel:languages:D/dmd devel:languages:D]
 
|
 
|
 
|
 
|
*[https://build.opensuse.org/project/show/devel:languages:D devel:languages:D] (0.15.1)
+
*[https://build.opensuse.org/project/show/devel:languages:D devel:languages:D]
*[https://build.opensuse.org/project/show/home:marc_schuetz:branches:devel:languages:D home:marc_schuetz] (0.15.2-beta2)
+
*[https://build.opensuse.org/project/show/home:marc_schuetz:branches:devel:languages:D home:marc_schuetz]
 
|---
 
|---
 
!CentOS
 
!CentOS
Line 323: Line 319:
 
!Arch Linux
 
!Arch Linux
 
|
 
|
*Community (2.071.1)
+
*Community
 
|
 
|
*Community (5.2.0)
+
*Community
 
*AUR ([https://aur.archlinux.org/packages/gdc-git/ git HEAD])
 
*AUR ([https://aur.archlinux.org/packages/gdc-git/ git HEAD])
 
|
 
|
*Community (0.15.1)
+
*Community
 +
*AUR ([https://aur.archlinux.org/packages/ldc-git/ git HEAD])
 
|---
 
|---
 
!Gentoo
 
!Gentoo
Line 336: Line 333:
 
|
 
|
 
*[http://dlang.org/download.html Manual download]
 
*[http://dlang.org/download.html Manual download]
*Ports (2.067.0)
+
*Ports
 
|
 
|
 
|
 
|

Revision as of 22:18, 13 August 2016

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.

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
  • Android (source)
  • Windows (alpha)
  • Linux
  • OS X (untested)
  • FreeBSD (untested)
  • Windows
  • Linux
  • OS X
  • FreeBSD
  • OpenSolaris
  • iOS (experimental)
  • Android (alpha)
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
  • armel

Near-complete support:

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

Partial or bare-metal only support:

  • armhf
  • mips
  • s390x
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
  • Windows / 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
  • DMD Intel-like syntax (i386/amd64)
  • GCC syntax (all targets)
  • DMD Intel-like syntax (i386/amd64)
  • GCC syntax (all targets)
  • LLVM inline IR
SIMD Partial (?) Partial (?) Partial (?)
Phobos as a shared library
  • Linux
  • FreeBSD ?
  • Linux
Building D code as shared library
  • Linux
  • FreeBSD ?
  • 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 (32 & 64) COFF COFF

Package and/or binary availability, by platform and compiler

This list had outdated information about package version - thus version information has been removed. Please check the most recent available package yourself on the linked pages.


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
  • DVM (Any version)
Distribution-specific packages
Debian
Ubuntu

gdc

ldc

Fedora

See https://apps.fedoraproject.org/packages/ldc

OpenSuse
CentOS
Arch Linux
  • Community
Gentoo see https://wiki.gentoo.org/wiki/Dlang
FreeBSD

Experimental compilers and forks

  • SDC (Stupid 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"
  • 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)

Category page: Experimental compilers