Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
D (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Implementations== Most current D implementations [[compiler|compile]] directly into [[machine code]]. Production ready compilers: * ''DMD'' β The ''Digital Mars D compiler'' by Walter Bright is the official D compiler; open sourced under the [[Boost Software License]].<ref name="D-frontend-license" /><ref name="boost-backend" /> The DMD frontend is shared by GDC (now in GCC) and LDC, to improve compatibility between compilers. Initially the frontend was written in C++, but now most of it is written in D itself (self-hosting). The backend and machine code optimizers are based on the Symantec compiler. At first it supported only 32-bit x86, with support added for 64-bit amd64 and PowerPC by Walter Bright. :Bright said in 2020 "The biggest project is implementing the D compiler itself in 100% D".<ref name="bright20200526">{{Cite web |last=Bright |first=Walter |date=2020-05-26 |title=Re: Duff's device |url=https://news.ycombinator.com/item?id=23307367 |access-date=2025-04-06 |website=Hacker News}}</ref> The backend and almost the entire compiler was ported from C++ to D for full [[bootstrapping (compilers)|bootstrapping]]. * ''GCC'' β The [[GNU Compiler Collection]], merged GDC<ref>{{cite web|url=https://gdcproject.org/ |title=GDC}}</ref> into GCC 9 on 29 October 2018.<ref>{{cite web |title=GCC 9 Release Series β Changes, New Features, and Fixes - GNU Project - Free Software Foundation (FSF) |url=https://gcc.gnu.org/gcc-9/changes.html#d |website=gcc.gnu.org |access-date=2020-05-07}}</ref> The first working versions of GDC with GCC, based on GCC 3.3 and GCC 3.4 on 32-bit x86 on Linux and macOS<ref>{{cite web |title=Another front end for GCC |url=https://forum.dlang.org/post/c3mnst$2htg$1@digitaldaemon.com |website=forum.dlang.org |access-date=2020-05-07}}</ref> was released on 22 March 2004. Since then GDC has gained support for additional platforms, improved performance, and fixed bugs, while tracking upstream DMD code for the frontend and language specification.<ref>{{Cite web|url=https://gcc.gnu.org/gcc-9/changes.html|title=GCC 9 Release Series Changes, New Features, and Fixes}}</ref> * ''LDC'' β A compiler based on the DMD front-end that uses [[LLVM]] as its compiler back-end. The first release-quality version was published on 9 January 2009.<ref>{{cite web |url=https://github.com/ldc-developers/ldc |title=LLVM D compiler project on GitHub |website=[[GitHub]] |access-date=19 August 2016}}</ref> It supports version 2.0.<ref>{{cite web |url=http://www.dsource.org/projects/ldc/wiki/BuildInstructionsPhobosDruntimeTrunk |title=BuildInstructionsPhobosDruntimeTrunk β ldc β D Programming Language β Trac |access-date=11 August 2015}}</ref> Toy and proof-of-concept compilers: * ''D Compiler for [[.NET]]'' β A back-end for the D programming language 2.0 compiler.<ref>{{cite web |title=D .NET project on CodePlex |url=http://dnet.codeplex.com/ |access-date=3 July 2010 |archive-date=26 January 2018 |archive-url=https://web.archive.org/web/20180126042332/http://dnet.codeplex.com/ |url-status=dead}}</ref><ref>{{cite web |title=Source for the D.NET Compiler is Now Available |url=http://www.infoq.com/news/2009/05/D-Source |publisher=InfoQ |access-date=6 July 2010 |author=Jonathan Allen |date=15 May 2009}}</ref> It compiles the code to [[Common Intermediate Language]] (CIL) bytecode rather than to machine code. The CIL can then be run via a [[Common Language Infrastructure]] (CLI) [[virtual machine]]. The project has not been updated in years and the author indicated the project is not active anymore. * ''SDC'' β The ''Snazzy D Compiler''<ref>{{cite web |title= Make SDC the Snazzy D compiler |website=[[GitHub]] |url=https://github.com/snazzy-d/sdc/commit/7933fa47a865bd4b18c6327613c8407127d4e091 |access-date=24 September 2023}}</ref> uses a custom front-end and [[LLVM]] as its compiler back-end. It is written in D and uses a scheduler to handle symbol resolution in order to elegantly handle the compile-time features of D. This compiler currently supports a limited subset of the language.<ref>{{cite AV media |title=DConf 2014: SDC, a D Compiler as a Library by Amaury Sechet |website = [[YouTube]]|url=https://www.youtube.com/watch?v=AhR4PSExnqk |access-date=8 January 2014}}{{cbignore}} Archived at [https://ghostarchive.org/varchive/youtube/20211211/AhR4PSExnqk Ghostarchive]{{cbignore}} and the [https://web.archive.org/web/20150326150804/https://www.youtube.com/watch?v=AhR4PSExnqk Wayback Machine]{{cbignore}}</ref><ref>{{cite web |title=deadalnix/SDC |website=[[GitHub]] |url=https://github.com/deadalnix/SDC |access-date=8 January 2014}}</ref> Using above compilers and toolchains, it is possible to compile D programs to target many different architectures, including [[IA-32]], [[amd64]], [[AArch64]], [[PowerPC]], [[MIPS64]], [[DEC Alpha]], [[m68k|Motorola m68k]], [[SPARC]], [[ESA/390|s390]], [[WebAssembly]]. The primary supported operating systems are [[Windows]] and [[Linux]], but various compilers also support [[Mac OS X]], [[FreeBSD]], [[NetBSD]], [[AIX]], [[Solaris (operating system)|Solaris/OpenSolaris]] and [[Android (operating system)|Android]], either as a host or target, or both. [[WebAssembly]] target (supported via LDC and LLVM) can operate in any WebAssembly environment, like modern web browser ([[Google Chrome]], [[Mozilla Firefox]], [[Microsoft Edge]], [[Apple Safari]]), or dedicated Wasm virtual machines.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)