D (2.112)

This assessment applies the coupling account — coupling as access to a shared resource, and the coupling floor [1], [2] — and the knowledge-embodiment theorem [3]; the language is assessed against its official reference [4].

Snapshot D (2.112) — released 7 January 2026 · lifecycle superseded (successor release 2.113 (2026))

Family D — shelf: Application

The language’s main business is building general application software, with a managed runtime or a rich standard library. A shelf groups; it does not classify — the tags below carry every use, paradigm, and platform of this snapshot.

Trajectory 0.01 (December 2001 — first public release) · 2.112 (7 January 2026 — assessed release)

Tags

Use — Application, Systems

Paradigm — Object-oriented, Imperative, Concurrent

Platform — Native

Lifecycle — Superseded

Memory — Managed (GC)

Typing — Static, strong

Resources

The language’s official entry points, and the documents that name the release this page assesses. A link marked this release pins the document to D (2.112); an unmarked link is the current reference for the language.

Landing page

Specification and reference

API documentation

Tutorial

Package registry

1 Assessment

This page assesses D in five parts: core coupling — what the language’s own constructs force; ecosystem coupling — what the surrounding platform, tooling, and community cost; engineering readiness — whether the artifact can be reproduced, verified, observed, worked in quickly, connected to other languages, and governed openly; the profile — the unscored facts a score cannot express; and the scoring detail — the mechanism marks and the arithmetic behind every score. A ✅ bullet marks a construct that helps. A ⚠️ or ❌ bullet marks a cost; the scoring model does not price every cost named here.

Core coupling 71.4/100 · Ecosystem coupling 87.9/100 · Engineering readiness 56.7/100

1.1 Core coupling

1.1.1 Type

  • ✅ Static typing with inference: auto, template argument deduction, and typeof infer most declarations, so the type is fixed at compile time without being written at every site
  • ✅ Templates avoid the angle-bracket problem: Instantiation uses the ! syntax (foo!int, foo!(int, string)) with if (isInputRange!R) constraints, so generic code carries none of C++’s nested <> noise
  • ✅ Modules are the compilation boundary: A module is declared with module in one source file and consumed with import, so there are no headers and no include guards tying a declaration to a textual include order
  • ✅ UFCS decouples call syntax from the definition site: x.f(y) is rewritten to f(x, y), so a free function composes into a method-call chain without being a member of the type
  • ✅ immutable and const are transitive: A qualifier reaches through pointers and members, so a read-only view is stated once rather than per access
  • ⚠️ Operator overloading is not visible in cost: opBinary, opCmp, opIndex, and opAssign let a type redefine +, <, [], and =, so a dense expression can hide work the call site does not show (T8)

1.1.2 Construction

  • ✅ Structs are constructed in place: struct is a value type, so a local, a field, or an array element is constructed where it is declared without a heap allocation
  • ✅ Contract programming separates the specification from the body: in, out, and invariant blocks state preconditions, postconditions, and class invariants as separate declarations, so a check is not buried in the implementation
  • ✅ scope guards attach cleanup to the construction site: scope(exit), scope(success), and scope(failure) run at block exit beside the code that acquired the resource
  • ✅ @disable this() forbids an illegal construction: A type can delete a constructor, so an object cannot be built by calling new
  • ⚠️ Mutability is the default: A variable is mutable unless it is declared immutable or const, so immutability is opt-in rather than the default reading of a declaration (C2)
  • ❌ One value, many names: class references and pointers alias; ScopedAlias and Unique are opt-in attributes the default code skips (C6)
  • ❌ C++-style module init: cross-module order is not stated in source (C8)

1.1.3 Memory

  • ❌ Garbage collection pauses are non-deterministic: The default new path allocates on the collector’s heap, and a collection runs on the collector’s schedule rather than the program’s (M2)
  • ⚠️ RAII is partial: Struct destructors (~this) and scope(exit) release a value type deterministically, but a class instance is collected, so its destructor has no defined run time (M3)
  • ❌ No ownership or lifetime checking: The compiler does not track which reference owns an allocation, so a dangling pointer or a double release in @system code is not diagnosed (M4)
  • ✅ @nogc removes the collector from a call tree: A @nogc function may not allocate through the GC, so its pauses are excluded at compile time
  • ✅ -betterC excludes the runtime entirely: The program links without druntime or the collector, which is what the embedded and no-GC case needs
  • ✅ destroy releases a value at a chosen point: destroy(x) runs the destructor and resets the value, giving an explicit release where the collector would otherwise decide
  • ❌ Bytes can be read as a type they never were: cast between unrelated pointer types compiles unchecked, and the specification hands the representation question to the programmer as undefined behaviour (M6)
  • ❌ The undeclared class has no catch: a wild pointer on the GC heap (the @system-safety escape, documented) corrupts memory, below every catch clause (Er6)
  • ❌ Class references are counted by default; cycles leak unless the GC mode is enabled (M7)

1.1.4 Error

  • ❌ Unchecked exceptions are the only error channel: throw needs no declaration in the signature and the compiler does not check that a handler exists; nothrow is an opt-in promise (Er2)
  • ✅ nothrow names the functions that cannot fail: A nothrow function may not throw, so the property is checked at the declaration
  • ✅ scope(failure) separates the recovery path from the normal path: Cleanup written there runs only when the block leaves by an exception
  • ✅ try/catch/finally is the standard shape: A catch clause names the type it handles, and finally runs on every exit
  • ⚠️ Contracts and assertions disappear under -release: in, out, and assert are compiled out in a release build, so their guarantee is a debug-time one
  • ❌ A fault ends the process: an uncaught exception in a thread terminates the process (documented) (Er5)

1.1.5 Concurrency

  • ✅ The shared qualifier makes cross-thread state visible: Data declared shared cannot be read or written through an ordinary reference, so the cast that crosses a thread boundary is the place the synchronisation is declared
  • ✅ std.concurrency gives message passing: spawn starts a thread with its own message queue, and send/receive pass values between threads without a shared lock
  • ✅ std.parallelism gives structured parallel loops: parallel and taskPool map a loop body over a range, so the common data-parallel case is stated rather than hand-threaded
  • ✅ Atomic primitives are in the standard library: core.atomic provides atomicOp, cas, and atomicLoad, so a lock-free update has a named primitive
  • ❌ Synchronisation is manual and unchecked: synchronized, Mutex, and core.atomic are the only tools, and the compiler does not prove the locking discipline or detect a race (K3)

1.1.6 Platform

  • ✅ Three independent compilers target the same language: dmd uses its own Digital Mars backend, ldc uses LLVM, and gdc uses the GCC backend, so a program is not bound to one vendor’s toolchain
  • ✅ Native code is produced for many targets: Linux, Windows, macOS, and the BSDs on x86, x86-64, ARM, and AArch64 are supported targets
  • ✅ C and C++ interoperability is a language feature: extern(C), extern(C++), and the importC compiler feature let a D module call existing C and C++ binaries without a binding generator
  • ✅ -betterC removes the runtime dependency: A BetterC program links like a C program, without druntime or a GC
  • ✅ The C preprocessor is not part of the language: There is no textual include and no macro layer above the module system
  • ⚠️ The three compilers advance at different rates: ldc and gdc follow dmd’s front end with a lag, so a version-specific feature may not be available on every compiler at once

1.1.7 Trade-offs (not coupling)

  • Better C++ is a target, not a guarantee: Porting C++ to D is a rewrite with its own cost, and the two languages interoperate at the ABI rather than at the source
  • GC or manual memory is a per-program choice: -betterC and @nogc buy determinism at the cost of the collector’s convenience
  • Compile-time execution is a deliberate shift of work: CTFE, static if, and string mixins move computation to the build, so it is not a runtime mechanism at all
  • Multiple paradigms widen the surface: Imperative, object-oriented, functional, and metaprogramming styles are all supported, and the choice is the programmer’s
  • Niche adoption is a market fact, not a language defect: The smaller library pool follows from adoption, not from a construction of the language

1.2 Ecosystem coupling

1.2.1 Performance

  • ✅ Native compilation with no interpreter: dmd, ldc, and gdc emit machine code, so there is no bytecode dispatch or JIT warm-up between the source and the CPU
  • ✅ ldc and gdc reuse mature optimisers: The LLVM and GCC backends apply the optimisation pipeline that compiles C and C++
  • ✅ CTFE moves work to compile time: static if, mixin, and template instantiation are evaluated by the compiler, so the runtime pays nothing for them
  • ✅ @nogc bounds the runtime cost of a call tree: A function that cannot allocate has no collector interaction at all
  • ⚠️ The collector remains a latency risk: Throughput is good, but a collection can still lengthen a pause in code that allocates, so a latency-sensitive path needs @nogc (R2)

1.2.2 Ecosystem

  • ❌ The library pool is small: dub’s package registry is far smaller than crates.io, npm, or Maven, so a project is more likely to write a library than to find one (Ec3)
  • ✅ dub is a standard package manager and build tool: dub.json or dub.sdl declares dependencies and targets, and dub build, dub run, and dub test cover the ordinary workflow
  • ✅ The C and C++ ecosystems are reachable: extern(C), extern(C++), and importC reduce the need for a D-specific binding
  • ✅ vibe.d supports web services: An asynchronous I/O framework covers HTTP and socket work on the D runtime
  • ⚠️ Corporate backing is weak: The language is carried by its contributors rather than by a large vendor, so long-term support is the community’s

1.2.3 Evolution

  • ✅ A deprecation cycle precedes a removal: A feature is deprecated for a release series before it is removed, and the changelog records both steps
  • ✅ -preview flags gate changes to the front end: A new language behaviour ships behind a flag first, so a change can be tested before it becomes the default
  • ✅ The DIP process documents proposals publicly: The D Improvement Proposal repository holds the rationale for a language change
  • ⚠️ Removals do happen: The changelog records deprecated features that were later dropped, so older source can need an edit at a major front-end step
  • ⚠️ Front-end versions differ across the three compilers: A change fixed in dmd reaches ldc and gdc later, so a project can be pinned to one compiler for a period

1.2.4 Domain

  • ✅ Systems and performance work is the design target: Native code, value types, and direct C interop are the native idiom
  • ✅ Game development is a stated fit: The GC can be excluded, structs stay in place, and templates specialise per case, which is what a game loop needs
  • ✅ Embedded and no-runtime work is supported by -betterC: The program links without druntime, so it fits a bare-metal or constrained target
  • ✅ Web services are supported by vibe.d: The framework covers asynchronous HTTP on the same runtime
  • ⚠️ The collector is the wrong model for hard real-time: A latency bound requires @nogc or BetterC throughout the allocating path
  • ⚠️ D is rarely the default choice in any of these domains: The fits are real, but the surrounding library and hiring pool is smaller

1.2.5 Learning

  • ✅ Moderate for an experienced C++ developer: Templates, RAII-style cleanup, and value types have direct C++ analogues
  • ✅ Templates are easier to read than C++ templates: The ! instantiation syntax and if constraints remove the ambiguity of nested angle brackets
  • ✅ Contract programming is a small notation: in, out, and invariant are a few keywords over the ordinary function body
  • ⚠️ The metaprogramming surface is large: Templates, static if, CTFE, traits, and string mixins each have their own rules
  • ⚠️ The memory model is two models at once: A developer must know which allocations are collected and which are not, and @nogc makes the distinction a compile-time obligation
  • ⚠️ Four paradigms are available at once: Imperative, object-oriented, functional, and metaprogramming styles widen the surface a newcomer must choose from

1.2.6 Syntax

  • ✅ Cleaner than C++ for similar expressive power: A module is one file, there is no header text, and there is no preprocessor
  • ✅ ! makes template instantiation unambiguous: foo!int cannot be confused with a comparison, which is C++’s parsing problem
  • ✅ auto removes a declaration without hiding the type: The type is inferred and still checked at compile time
  • ✅ scope(exit) is a compact cleanup notation: One line states the release that other languages spell as a try/finally
  • ⚠️ Attributes accumulate on a signature: @safe @nogc @property nothrow pure and their variants stack up, and the combination is part of the contract
  • ⚠️ String mixins hide the generated code: mixin("...") inserts source the reader cannot see in the file’s order

1.2.7 Testing

  • ✅ unittest blocks are part of the language: A unittest { ... } block sits beside the code it tests, and it is compiled in when the -unittest flag is passed
  • ✅ dub test runs the blocks: The package manager builds and runs the test configuration
  • ✅ Contracts are executable invariants: in, out, and invariant checks fail with a trace when a precondition is broken
  • ✅ Coverage is built in: dmd -cov writes a per-line coverage report from a normal run
  • ⚠️ Tests are compiled only with -unittest: A release build carries no test code, so the test set is a build configuration rather than a language guarantee
  • ⚠️ The test library is third-party: Fixture, mocking, and property-test helpers come from packages such as unit-threaded rather than from the standard library

1.2.8 Security

  • ✅ @safe is checked by the compiler: @safe code may not do pointer arithmetic, lose a type through a cast, or call @system code, so the unsafe operations are the ones that were declared
  • ✅ Bounds checking is kept where it is required: An array or a slice carries its length, and @safe code retains the index check
  • ✅ Variables are initialised by default: A variable starts at its .init value, so the uninitialised-read class of bug does not arise as it does in C; the = void opt-out is named at the declaration, and @safe code forbids it for types that may hold pointer values
  • ⚠️ @trusted and cast are the escape hatch: A @trusted function or a pointer cast re-opens the unsafe surface, and its correctness is the author’s claim
  • ⚠️ The collector and the runtime are part of the attack surface: A bug in druntime or the collector is reachable from a @safe program
  • ⚠️ -release removes the contract checks: Assertions and contracts are compiled out, so a release build relies on the checks that @safe keeps
  • ❌ Machine integers follow C semantics: overflow is silent (Q4)

1.2.9 Delivery targets

What ships from a producer to a consumer, and whether the interface across a release boundary is promised. Ec8 is present when one compiled target crosses with no promise.

Target Ships as Crosses a producer boundary Cross-release promise
dub package source source no Dub compiles dependencies with the compiler in use

1.3 Engineering readiness

1.3.1 Reproducibility

  • ❌ Dub resolves dependency versions at build time. (Y1)
  • ❌ Dependency versions resolve from the registry unless pinned. (Y2)
  • ❌ No toolchain pin exists in the official distribution. (Y14)

1.3.2 Supply chain

  • ❌ Dub packages carry no signed provenance. (Y3)
  • ❌ The package registry is a flat name space. (Y4)
  • ❌ No advisory feed covers Dub packages. (Y16)

1.3.3 Observability

  • ❌ No tracing standard exists in the language. (Y5)

1.3.4 Feedback

  • ❌ No debugger ships with the compilers. (Y13)

1.3.5 Interop

  • ✅ extern(C) calls any C library in process; the C model is native to D. (Y9)
  • ✅ dmd and ldc target the common platforms. (Y10)

1.3.6 Governance

  • ✅ The D Language Foundation and the community govern in the open. (Y11)
  • ✅ The language specification is public. (Y12)
  • ✅ dmd and ldc are public source. (Y19)

1.4 Profile

Unscored, and kept separate from every score on purpose. The profile records what a mechanism price cannot express: what a running program costs, how well a coding model and an agent work in the language, and whether a safety-critical path exists.

1.4.1 Energy and cost

What this axis asks: what does a running program cost in energy and time?

  • ✅ Compiles to native code: the fastest class in the language energy and time benchmarks [5], [6]. A causal re-analysis attributes the difference to execution time [7].

1.4.2 AI and agent readiness

What this axis asks: how well does a coding model and an agent work in this language?

  • ❌ Sparse training data: models write it unreliably [8].

1.4.3 Safety certification

What this axis asks: is there a certified or standards-qualified path to a safety-critical system?

  • ⚠️ No certified or standards-qualified path for safety-critical systems.

1.5 Scoring detail

1.5.1 Core coupling Dimensions

Dimension Mechanism Description Imposed by Present Weight
Type T1 dynamic no static check language — 0
T2 weak static language — 0
T3 dynamic/duck dispatch language — 0
T4 no sum types language — 0
T5 no generics language — 0
T6 no namespaces language — 0
T7 type erasure/reflection language — 0
T8 operator overloading language ✅ −4
T9 inheritance required for polymorphism language — 0
T10 no null-safety language — 0
T11 no module boundary language — 0
T12 no effect tracking language — 0
T13 async/sync colouring language — 0
T14 unchecked foreign boundary language ✅ −4
T15 chars are encoding units language — 0
Type cost −2.3 (−8)
Construction C1 global mutable state by default language — 0
C2 no immutability by default language ✅ −4
C3 constructors coupled to allocation language — 0
C4 no constructor/validation language — 0
C5 unpinned collection order language — 0
C6 aliasing by default language ✅ −8
C7 undeclared control transfer language — 0
C8 no source-visible init order language ✅ −8
Construction cost −5.7 (−20)
Memory M1 manual deallocation runtime — 0
M2 GC non-deterministic pauses runtime ✅ −8
M3 no RAII language ✅ −4
M4 no ownership model language ✅ −8
M5 uninitialized reads language — 0
M6 unchecked reinterpretation language ✅ −8
Er6 uncatchable runtime fault language ✅ −8
M7 reference cycles leak runtime ✅ −8
Memory cost −12.6 (−44)
Error Er1 no structured path language — 0
Er2 unchecked exceptions only language ✅ −8
Er3 errors ignored/non-exhaustive language — 0
Er4 no composable result type language — 0
Er5 no isolation unit for a fault runtime ✅ −8
Error cost −4.6 (−16)
Concurrency K1 GIL/no parallel runtime — 0
K2 shared mutable state default language — 0
K3 manual sync no race detection runtime ✅ −8
K4 no structured concurrency language ✅ −4
K5 no primitives language — 0
K6 thread-per-task cost runtime — 0
Concurrency cost −3.4 (−12)
Platform P1 cannot function outside one vendor/domain context — 0
P2 single-vendor but other uses context — 0
P3 legacy/discontinued platform context — 0
P4 poor domain fit context — 0
Platform cost 0

Core coupling score: 71.4/100 — 100 of the 350 inventory points are present, so the axis cost is 100 × 100 ÷ 350 = 28.6 and the score is 100 − 28.6. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

1.5.2 Ecosystem coupling Dimensions

Dimension Mechanism Description Imposed by Present Weight
Performance R1 interpreted no AOT/JIT runtime — 0
R2 GC pauses runtime ✅ −8
R3 JIT warmup runtime — 0
Performance cost −3.1 (−8)
Ecosystem Ec1 no package manager context — 0
Ec2 fragmented tooling context — 0
Ec3 small/niche/discontinued context ✅ −8
Ec4 proprietary context — 0
Ec5 platform-locked tooling context — 0
Ec6 monoculture context — 0
Ec7 legacy burden context — 0
Ec8 unpromised binary boundary context — 0
Ec9 unpromised data boundary context — 0
Ecosystem cost −3.1 (−8)
Evolution V1 breaking changes language — 0
V2 frozen context — 0
V3 discontinued context — 0
V4 glacial standards context — 0
V5 silent default drift runtime — 0
V7 build-variant state space context — 0
Evolution cost 0
Domain D1 domain/vendor lock-in context — 0
D3 framework forces architecture context — 0
Domain cost 0
Learning L1 steep context — 0
L2 large surface/multi-paradigm context — 0
L3 sparse docs context — 0
Learning cost 0
Syntax S1 verbose language — 0
S2 inconsistent language — 0
S3 punctuation-heavy language — 0
Syntax cost 0
Testing G1 weak tooling context — 0
G2 poor debugging context — 0
G3 runtime-only errors context — 0
G4 no published monotonic clock runtime — 0
Testing cost 0
Security Q1 memory-unsafe language — 0
Q2 dynamic/weak typing risk language — 0
Q3 known vulnerability/injection context — 0
Q4 silent integer overflow language ✅ −15
Security cost −5.9 (−15)

Ecosystem coupling score: 87.9/100 — 31 of the 256 inventory points are present, so the axis cost is 100 × 31 ÷ 256 = 12.1 and the score is 100 − 12.1. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

1.5.3 Engineering readiness Dimensions

Dimension Mechanism Description Imposed by Present Weight
Reproducibility Y1 build not reproducible context ✅ −15
Y2 dependencies not pinned context ✅ −8
Y14 no toolchain version pin context ✅ −8
Y18 no machine-read project contract context — 0
Reproducibility cost −18.1 (−31)
Supply chain Y3 no signed provenance context ✅ −15
Y4 registry without namespacing context ✅ −4
Y16 no advisory feed context ✅ −8
Supply chain cost −15.8 (−27)
Observability Y5 no stable tracing standard context ✅ −8
Y6 no structured logging context — 0
Y15 no post-mortem diagnostics runtime — 0
Observability cost −4.7 (−8)
Feedback Y7 slow build context — 0
Y8 no fast in-editor analysis context — 0
Y13 no bundled debugger context ✅ −8
Feedback cost −4.7 (−8)
Interop Y9 no foreign-function interface language — 0
Y10 no portable target context — 0
Interop cost 0
Governance Y11 single-vendor governance context — 0
Y12 closed specification context — 0
Y17 no conformance mechanism context — 0
Y19 no published parser context — 0
Governance cost 0

Engineering readiness score: 56.7/100 — 74 of the 171 inventory points are present, so the axis cost is 100 × 74 ÷ 171 = 43.3 and the score is 100 − 43.3. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

Verdict: D’s design yields moderate language-imposed coupling for a language of its reach. The module system replaces headers, UFCS separates call syntax from definition, and contract blocks separate the specification from the body. Predicates such as @safe, @nogc, and nothrow turn several memory and error properties into declared and checked facts. Main strengths: compile-time execution removes metaprogramming from the runtime, three independent compilers keep the toolchain from locking in, and -betterC reaches the embedded case. Main weaknesses: unchecked exceptions are the only error channel, the collector’s pauses are not deterministic, no ownership model detects aliasing, and the ecosystem stays niche with weak corporate backing.


The formal development. The definitions, theorems, and proofs behind this page are published in:

All published papers

References

[1]
Y. Loth, “On the nature of coupling: All coupling as shared resource access.” Zenodo, Aug. 2026. doi: 10.5281/zenodo.21925121.
[2]
Y. Loth, “Coupling as a consequence of cohesion: Decomposition, the coupling floor, and domain-imposed coupling.” Zenodo, Aug. 2026. doi: 10.5281/zenodo.21925201.
[3]
Y. Loth, “On the nature of cohesion: Cohesion as correctness relative to a partitioning rule.” Zenodo, Jul. 2026. doi: 10.5281/zenodo.20492912.
[4]
W. Bright and A. Alexandrescu, “The d language specification.” D Language Foundation, 2024. Available: https://dlang.org/spec/spec.html
[5]
R. Pereira et al., “Energy efficiency across programming languages: How do energy, time, and memory relate?” in Proceedings of the 10th ACM SIGPLAN international conference on software language engineering (SLE), 2017, pp. 256–267. doi: 10.1145/3136014.3136031.
[6]
R. Pereira et al., “Ranking programming languages by energy efficiency,” Science of Computer Programming, 2021, doi: 10.1016/j.scico.2021.102609.
[7]
N. van Kempen, H.-J. Kwon, D. T. Nguyen, and E. D. Berger, “It’s not easy being green: On the energy efficiency of programming languages,” in Proceedings of the 40th IEEE/ACM international conference on automated software engineering (ASE), 2025. doi: 10.1109/ASE63991.2025.00131.
[8]
S. Joel, J. J. Wu, and F. H. Fard, “A survey on LLM-based code generation for low-resource and domain-specific programming languages,” ACM Transactions on Software Engineering and Methodology, 2025, doi: 10.1145/3770084.