D is a general-purpose programming language with
static typing, systems-level access, and C-like syntax.
With the D Programming Language, write fast,
read fast, and run fast.
Fast code, fast.
Got a brief example illustrating D?
Submit your code to the digitalmars.D forum specifying "[your code here]" in the subject.
Upon approval it will be showcased here on a random schedule.
2 3 3 4 + * *
void main() { import std.stdio, std.string, std.algorithm, std.conv; // Reduce the RPN expression using a stack readln.split.fold!((stack, op) { switch (op) { // Generate operator switch cases statically static foreach (c; "+-*/") case [c]: return stack[0 .. $ - 2] ~ mixin("stack[$ - 2] " ~ c ~ " stack[$ - 1]"); default: return stack ~ op.to!real; } })((real[]).init).writeln; }
Running...
Support the D language
D is made possible through the hard work and dedication of many volunteers, with the coordination and outreach of the D Language Foundation, a 501(c)(3) non-profit organization. You can help further the development of the D language and help grow our community by supporting the Foundation.
Donate
Learn More About The Foundation
Lots of to our sponsors and
contributors.
Industry Proven
News
Stay updated with the latest posts in the Official D Blog from March 24, 2022: Reducing Template Compile Times by Max Haughton.
From February 19, 2022: How I Taught the D Programming Language at a Russian University by Grigorii Smorkalov and Georgy Markov.
Learn
Take the Tour, explore major features in D, browse the quick overview, start with C or C++ background, and ask questions in the Learn forum.
For a deeper dive into D check out books or videos such as Ali Çehreli's free book Programming in D.
Community
Discuss D on the forums, join the IRC channel, read our official Blog, or follow us on Twitter. Browse the wiki, where among other things you can find the high-level vision of the D Language Foundation.
Documentation
Refer to the language specification and the documentation of Phobos, D's standard library. The DMD manual tells you how to use the compiler. Read various articles to deepen your understanding.
Contribute
Report any bugs you find to our bug tracker. If you can fix an issue, make a pull request on GitHub. There are many other ways to help, too!
Packages
DUB is the package manager for D. Get started with DUB, and check out the available packages.
Run
Configure linting, formatting or completion for your favorite IDE, editor or use run.dlang.io to play and experiment with D code.
Explore
Learn about pragmatic D, the DStyle, common D idioms and templates, See what's coming upcoming with next version, explore D Improvement Proposals, and don't fear D's garbage collection.
Fast code, fast.
Write Fast
D allows writing large code fragments without redundantly specifying types, like dynamic languages do. On the other hand, static inference deduces types and other code properties, giving the best of both the static and the dynamic worlds. Show example
Automatic memory management makes for safe, simple, and robust code. D also supports scoped resource management (aka the RAII idiom) and scope statements for deterministic transactional code that is easy to write and read. Show example
Built-in linear and associative arrays, slices, and ranges make daily programming simple and pleasant for tasks, both small and large. Show example
Read Fast
The best paradigm is to not impose something at the expense of others. D offers classic polymorphism, value semantics, functional style, generics, generative programming, contract programming, and more—all harmoniously integrated. Show example
D offers an innovative approach to concurrency, featuring true immutable data, message passing, no sharing by default, and controlled mutable sharing across threads. Read more.
From simple scripts to large projects, D has the breadth to scale with any application's needs: unit testing, information hiding, refined modularity, fast compilation, precise interfaces. Read more.
Run Fast
D compiles naturally to efficient native code.
D is designed such that most "obvious" code is fast and safe. On occasion a function might need to escape the confines of type safety for ultimate speed and control. For such rare cases D offers native pointers, type casts, access to any C function without any intervening translation, manual memory management, custom allocators and even inline assembly code. Show example
The @safe, @trusted, and @system function attributes allow the programmer to best decide the safety-efficiency tradeoffs of an application, and have the compiler check for consistency. Read more.