D compiler release 2.100

The developers of the D programming language have released the main reference compiler DMD 2.100.0, which supports GNU/Linux, Windows, macOS and FreeBSD systems. The compiler code is distributed under the free license BSL (Boost Software License).

The D language is statically typed, has a syntax similar to C/C++, and provides the performance of compiled languages ​​while borrowing some of the useful design efficiency and security features of dynamic languages. For example, it provides support for associative arrays, indirect type inference, automatic memory management, parallel programming tools, an optional garbage collector, a templating system, components for metaprogramming, the ability to use C libraries, and some C++ and Objective-C libraries.

Among the changes in the new release:

  • Removed support for the old style of operator overloading used in the D1 branch. To replace opNeg, opAdd_r, opAddAssign, etc. came opUnary, opBinary, opBinaryRight and opOpAssign. The old style of operator overloading was deprecated in 2019 and will result in an error as of release 2.100.
  • Removed support for the delete keyword, deprecated as of 2018. Instead of delete, use the destroy or core.memory.__delete function.
  • A new @mustuse attribute has been implemented that can be applied to struct and union types as an alternative error handling method when exceptions cannot be used in code (for example, in @nogc blocks). If an expression marked with the @mustuse attribute is not used in the code, the compiler will generate an error.
  • For static arrays, the ".tupleof" property is allowed to get a sequence of values ​​(lvalue) of each element of the array. void foo(int, int, int) { /* … */ } int[3] ia = [1, 2, 3]; foo(ia.tupleof); // similar to foo(1, 2, 3); float[3]fa; fa.tupleof = ia.tupleof; // simple assignment fa = ia resulted in an error assert(fa == [1F, 2F, 3F]);

Source: opennet.ru

Add a comment