Ownership and Borrowing in D
If D manages to implement sound borrowing checking this will be huge! Brings it a step closer to matching Rust&#x27;s feature list.<p>- Zero-cost abstractions: Yes!<p>- Move semantics: Yes!<p>- Guaranteed memory safety: Yes! (in code marked with the appropriate annotations)<p>- Threads without data races: Yes!<p>- Trait-based generics: No!<p>- Pattern matching: No! (Although like C++, in can be done as a library: <a href="https:&#x2F;&#x2F;code.dlang.org&#x2F;packages&#x2F;sumtype" rel="nofollow">https:&#x2F;&#x2F;code.dlang.org&#x2F;packages&#x2F;sumtype</a>)<p>- Type inference: Yes! (Plus unlike Rust, you can also mark function return types auto, and let them be inferred too).<p>- Minimal runtime: Yes! (the GC could be disabled if using exclusively borrow-checked code)<p>- Efficient C bindings: Yes!<p>D also brings some features of its own to the table that Rust doesn&#x27;t yet match.<p>- Higher-kinded types (template template params): it&#x27;s possible to implement Haskell-style monads etc. in D, if for some reason you felt the need.<p>- Pure functions: these allow you to statically guarantee that a piece of code doesn&#x27;t perform any IO and is a completely deterministic function of its inputs. This makes reasoning about a large codebase much easier, compared to Rust where there&#x27;s no way to statically guarantee a function isn&#x27;t doing any IO.<p>- Fast compile times: the reference DMD compiler is almost as fast as the Go compiler, at least for code that doesn&#x27;t do a bunch of compile-time calculation.<p>- Compile-time compute: Rust now has constfn, but that still only supports a limited subset of the language. D allows almost the entire language to be used at compile time.<p>- Variadic templates: Something C++ users might miss when coming to Rust, they allow for the creation of things like tensors of arbitrary dimension (myTensor&lt;6, 3, 2, 5, 6, 20&gt;) on which operations are checked at compile time to ensure sizes are compatible (so it&#x27;s a compiler error if you try to multiply two tensors of the wrong size or wrong number of dimensions).