Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

Change Log: 2.077.0 (upcoming)

previous version: 2.076.0

Download D nightlies
To be released

List of all upcoming bug fixes and enhancements.

Compiler changes

  1. Mangled Symbols now back reference types and identifiers.

    Symbols with extern(D) linkage are now mangled using back references to types and identifiers if these occur more than once in the mangled name as emitted before. This reduces symbol length, especially with chained expressions of templated functions with Voldemort return types. For example, the average symbol length of the 127000+ symbols created by a phobos unittest build is reduced by a factor of about 3, while the longest symbol shrinks from 416133 to 1142 characters.

    See details in the ABI specification.

  2. Removed prelude assert for constructors & destructors

    The compiler used to insert an assert(this, "null this"); at the start of constructors & destructors. To trigger these asserts one needed to construct or destruct an aggregate at the null memory location. This would crash upon any data member access, which is required for a constructor or destructor to do anything useful.

Runtime changes

  1. core.atomic.atomicLoad's returns types have changed for aggregate types that have indirections.

    core.atomic.atomicLoad used to strip the shared qualifier off too eagerly. When an aggregate type has a "head" and a "tail", connected by an indirection, then atomicLoad used to strip shared off the tail. That was a bug (Bugzilla 16230). atomicLoad only loads the head. The tail remains in shared memory, and must keep the shared qualifier.

    When loading a struct that contains indirections, atomicLoad now returns a wrapper that provides getters which return properly typed values.

    When loading a class reference, atomicLoad now leaves the shared qualifier on.


    class C { int value; }
    shared C shc = new C;
    struct S { int head; int* tailPointer; }
    shared int tail = 1;
    auto shs = shared S(2, &tail);
    void main()
        import core.atomic : atomicLoad, atomicOp;
        // Loading a class reference:
        shared C c = atomicLoad(shc);
        // c itself is not actually shared. It's safe to copy it non-atomically:
        shared C c2 = c; // ok
        // c's fields are still shared and need to be loaded atomically:
        int v = atomicLoad(c.value);
        // Loading a struct that has an indirection:
        auto s = atomicLoad(shs);
        // The struct's head has been copied and can be modified non-atomically:
        // The tail is still shared and needs to be handled atomically:
        shared(int)* t = s.tailPointer;
        atomicOp!"+="(*t, 1);
  2. Vectorized array operations are now templated

    Array operations have been converted from dedicated assembly routines for some array operations to a generic template implementation for all array operations. This provides huge performance increases (2-4x higher throughput) for array operations that were not previously vectorized. Furthermore the implementation makes better use of vectorization even for short arrays to heavily reduce latency for some operations (up to 4x).

    For GDC/LDC the implementation relies on auto-vectorization, for DMD the implementation performs the vectorization itself. Support for vector operations with DMD is determined statically (-march=native, -march=avx2) to avoid binary bloat and the small test overhead. DMD enables SSE2 for 64-bit targets by default.

    Also see druntime#1891

    Note: The implementation no longer weakens floating point divisions (e.g. ary[] / scalar) to multiplication (ary[] * (1.0 / scalar)) as that may reduce precision. To preserve the higher performance of float multiplication when loss of precision is acceptable, use either -ffast-math with GDC/LDC or manually rewrite your code to multiply by (1.0 / scalar) for DMD.

List of all bug fixes and enhancements in D 2.077.0 (upcoming):

DMD Compiler bugs

  1. Bugzilla 11259: __traits(isSame) fails on the result of __traits(parent) if parent is a package
  2. Bugzilla 17370: [scope] Escaping scope pointers possible via struct GC allocation
  3. Bugzilla 17568: [scope] addresses to fields can be escaped from scope method
  4. Bugzilla 17725: [scope] escape from nested function to enclosing local
  5. Bugzilla 17782: The identifier delimiter of a delimited string can not begin with '_'
  6. Bugzilla 17790: [scope] Escaping pointer possible through array of aggregates

DMD Compiler enhancements

  1. Bugzilla 10523: Don't call array op functions for short vector ops
  2. Bugzilla 13262: Cannot send certain shared data to another thread
  3. Bugzilla 15831: IFTI voldemort type exploding bloat
  4. Bugzilla 17787: Add a BetterC predefined version so libraries can adapt

Phobos bugs

  1. Bugzilla 3191: std.zlib.UnCompress errors if buffer is reused
  2. Bugzilla 8779: std.zlib.UnCompress needs a way to detect end-of-stream
  3. Bugzilla 9505: std.zlib seem to be bugged
  4. Bugzilla 10444: writeln of a SIMD register
  5. Bugzilla 11389: template arity does not work with function type
  6. Bugzilla 12470: std.array.replace does not work with inout(char)[]
  7. Bugzilla 15096: std.array.array cannot be instantiated for pointers to ranges

Phobos enhancements

  1. Bugzilla 6004: std.range.unzip()
  2. Bugzilla 9183: Add a Nullable.get(x) overload
  3. Bugzilla 9591: std.typetuple.staticApplyMap
  4. Bugzilla 16512: std.allocator: Nullify the argument passed to allocator.dispose
  5. Bugzilla 17803: std.typecons.Tuple: opAssign should return ref Tuple

Druntime bugs

  1. Bugzilla 16230: core.atomic.atomicLoad removes shared from aggregate types too eagerly bugs

  1. Bugzilla 9958: "Integer FloatSuffix" is not a valid FloatLiteral
  2. Bugzilla 17649: instructions failed (no ../druntime dir) enhancements

  1. Bugzilla 17581: Document behavior of -betterC
previous version: 2.076.0