← New search

Other meanings of D (programming language)

Programming Languages

D (programming language)

D is a systems programming language created by Walter Bright and later co-designed with Andrei Alexandrescu. First released in 2001, D combines the performance and low-level control of C/C++ with modern high-level abstractions, such as garbage collection, functional programming constructs, and contract programming. It is statically typed, compiled to native code, and supports multiple paradigms, including imperative, object-oriented, and metaprogramming. D is designed to address practical issues in C++ development, such as build complexity and unsafe memory management, while retaining compatibility with C APIs and ABI. The language has evolved through several major versions, with D2 (introduced in 2007) becoming the standard, and continues to be maintained by an active open-source community.

2001
First release
Year D was first released
D2
Current major version
D2 is the standard version since 2007
GPL/BSL
License
Compiler and standard library licenses
~100
Contributors
Approximate number of active contributors to the D language repositories
1

Design and features

D's design emphasizes productivity and safety without sacrificing performance. It offers a garbage collector for automatic memory management, but also provides manual memory management options and @safe, @trusted, and @system attributes to control safety levels. The language includes built-in support for contracts (in/out blocks), unit testing, and design by introspection, which enables compile-time reflection and metaprogramming via templates and mixins. D's standard library, Phobos, provides a rich set of algorithms, containers, and ranges, which are lazily evaluated sequences that enable functional-style programming. Unlike C++, D uses a module system instead of header files, which simplifies compilation and reduces build times. The language also supports immutable data, pure functions, and a powerful template system that can generate code at compile time, making it suitable for high-performance computing and embedded systems.

2

History and evolution

Walter Bright, a compiler engineer known for his work on the Zortech C++ compiler, started developing D in 1999 and released the first version in 2001. The language was initially called 'Mars' but was renamed to D to reflect its evolution from C++. In 2006, Andrei Alexandrescu, author of 'Modern C++ Design', joined the design effort, leading to the D2 specification that introduced significant changes, including a more powerful template system, closures, and the removal of some deprecated features. The D language has been used in several notable projects, such as the Facebook chat backend (now Meta's Messenger) and the game engine 'DGame'. The language has faced challenges in gaining widespread adoption, partly due to the dominance of C++ and Rust, but it maintains a dedicated community and continues to receive updates, with the latest stable release being D 2.109.1 (as of 2025).

3

Tooling and ecosystem

D is supported by a range of compilers, with the reference implementation being the Digital Mars D compiler (DMD), which is known for its fast compilation times. The GDC compiler, based on the GNU Compiler Collection, and LDC, based on LLVM, offer alternative backends that produce highly optimized code. The DUB package manager simplifies dependency management and build automation, similar to Cargo for Rust or npm for JavaScript. The language has integrated documentation generation (DDoc), a built-in unit testing framework, and a code coverage tool. Integrated development environments such as Visual Studio Code, IntelliJ IDEA, and Eclipse have plugins for D, and the language server protocol implementation 'serve-d' provides code completion and refactoring. The D language community maintains a wiki, a forum, and an official website, and the language is hosted on GitHub, where it accepts contributions from a global developer base.

4

Lesser-known aspects

Beyond its mainstream features, D has several niche aspects. The language supports 'UFCS' (Uniform Function Call Syntax), which allows any function to be called as if it were a method, enabling a fluent style without modifying the type. D's 'scope' guards provide deterministic resource management, similar to RAII in C++, but with a simpler syntax. The 'shared' keyword enables safe concurrency by enforcing that shared data is accessed only through synchronized blocks, reducing data races. D also has a 'betterC' mode that compiles code without the runtime library, making it suitable for low-level systems programming and kernel development. The language's metaprogramming capabilities are so advanced that it can parse and manipulate its own source code at compile time, a feature used in libraries like 'mir' for high-performance numerical computing. Additionally, D has a built-in 'std.experimental' module that hosts experimental features, such as the 'ndslice' for multidimensional arrays, which are not yet stable but offer cutting-edge functionality.

Glossary

Phobos
The standard library of the D programming language, providing algorithms, containers, and ranges.
DUB
A package manager and build tool for D, similar to Cargo for Rust.
UFCS
Uniform Function Call Syntax, a feature that allows any function to be called as a method.
betterC
A compilation mode in D that produces code without the runtime library, suitable for low-level programming.

D is a registered trademark of the D Language Foundation.