Difference between revisions of "LDC"

From D Wiki
Jump to: navigation, search
(Useful Links)
Line 1: Line 1:
 
{{:Compilers_Widget}}
 
{{:Compilers_Widget}}
  
LDC uses the LLVM backend for code generation. LDC typically generates substantially faster binaries than DMD.
+
The LDC project aims to provide a portable D programming language compiler with modern optimization and code generation capabilities. The compiler uses the official DMD frontends to support both D1 and D2,
 +
and relies on the [http://llvm.org LLVM Core libraries] for code generation.
 +
 
 +
LDC is fully Open Source; the parts of the code not taken/adapted from other projects are BSD-licensed (see the [https://github.com/ldc-developers/ldc/blob/master/LICENSE LICENSE] file for details).
  
 
== Guides ==
 
== Guides ==

Revision as of 23:39, 12 December 2012

Compilers: OverviewDMDGDCLDC

The LDC project aims to provide a portable D programming language compiler with modern optimization and code generation capabilities. The compiler uses the official DMD frontends to support both D1 and D2, and relies on the LLVM Core libraries for code generation.

LDC is fully Open Source; the parts of the code not taken/adapted from other projects are BSD-licensed (see the LICENSE file for details).

Guides

Project status

In general, LDC should work fine on most x86/x86-64 Unix-like systems, including Linux, OS X 10.7+ and most BSD flavors. Code generation should work for other platforms supported by the LLVM MC codegen infrastructure (for example ARM), but druntime/Phobos support will most likely be lacking.

OS X version prior to 10.7 (Lion) are currently not supported by the D2 compiler, because LLVM's support for thread-local storage depends on functionality which first appeared in 10.7.

x86-64 Windows using MSVC

  • LDC/LDC2 from master branch compiles without patches.
  • See Building and hacking LDC on Windows using MSVC for detailed instructions.
  • LLVM 3.1 is required (3.0 does not work because of missing TLS support); LLVM 3.2 is supported, too.
  • druntime and Phobos compile but linker errors are still possible.
  • Exception handling still needs work (see here for a first patch; the llvm-objdump part of the patch is here and was commited in LLVM 3.3)
  • Contact: kai@redstar.de

ARM

  • Code generation is known to work.
  • Some initial work has been done on druntime, but support is not yet complete – see issue #116.

Useful Links