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.093.0

previous version: 2.092.1

Download D 2.093.0 Beta
to be released Jul 05, 2020

2.093.0 comes with 11 major changes and 0 fixed Bugzilla issues. A huge thanks goes to the 54 contributors who made 2.093.0 possible.

List of all bug fixes and enhancements in D 2.093.0.

Compiler changes

  1. Add new builtin __traits(isCopyable, T) for some type T

    Changing Phobos' std.traits.isCopyable to make use of this new builtin trait will reduce memory usage and, in turn, improve the performance of the compiler checking whether a type is copyable or not.

  2. Properly check interface implementations

    In previous releases the check to verify that a class implements all methods of the interfaces it implements was performed late in the compilation phase. This caused the check to not be performed when code generation was skipped (compiling with the -o- flag).

    In this release the check has been moved to an earlier phase of the compilation, causing errors to be reported even when the -o- flag is used. This can cause some breakage if a piece of code has only been compiled with the -o- flag.

    The compiler will now properly report an error for the following code when the -o- flag is used:

    interface Foo
    {
        void foo();
    }
    
    class Bar : Foo
    {
    
    }
    
  3. Allow initialization of shared variables.

    Shared variables can now be initialized when the -preview=nosharedaccess switch is used.

    void test()
    {
        shared int x;
        shared int y = 3;
    }
    
  4. Add -vtemplates switch to collect and list template statistics

    Template instantiations can consume lots of time and memory. By passing the -vtemplates switch to the compiler, the compiler will collect and print statistics about template usage in the code being compiled.

    For each template that was instantiated, a list of how many times it is instantiated, and how many of those instantiations are unique, is printed.

Runtime changes

  1. add exit_group to core.sys.linux.unistd

    add exit_group to core.sys.linux.unistd, exits all threads in a process, present since linux 2.5.35

  2. Added module core.sys.darwin.mach.nlist and core.sys.darwin.mach.stab

    Those modules contains bindings for the 64 bits part of Mac OSX's <mach-o/nlish.h> and <mach-o/stab.h>, respectively, and can be used by users wishing to inspect binary data of Mach-O object files.

  3. Deprecated object.selector

    The public import of selector in the module object has been deprecated. Please explicitly import selector instead using: import core.attribute : selector;

    The following code has been deprecated:

    extern (Objective-C)
    extern class NSObject
    {
        static NSObject alloc() @selector("alloc");
    }
    

    Replace with:

    import core.attribute : selector;
    
    extern (Objective-C)
    extern class NSObject
    {
        static NSObject alloc() @selector("alloc");
    }
    
  4. Memory releated GC options can now be specified with higher accuracy

    Memory-related GC options stored in bytes instead of megabytes to provide fine-tune GC on low memory devices.

    Added ability to use suffixes B, K, M or G:

    extern(C) __gshared string[] rt_options =
        [ "gcopt=minPoolSize:4K maxPoolSize:2M incPoolSize:8K" ];
    

    Values without suffix treated as megabytes.

Installer changes

  1. The install script now also works on the Windows command prompt.

    The official D version manager (install.sh, documented at dlang.org/install.html) used to require a POSIX environment. On Windows, prior to this release, this meant running the script and the compilers that it installed from within a POSIX terminal emulator as provided by MSYS2 or Cygwin. With this release it is now possible to install and activate compilers from the Windows command prompt directly.

    Assuming an MSYS2 installation is present in C:\msys64, necessary decompression tools can be installed from the Windows command prompt:

    C:\msys64\usr\bin\pacman.exe --sync unzip p7zip
    

    The following will invoke the script directly from dlang.org and install the latest dmd compiler in the %USERPROFILE%\dlang folder:

    C:\msys64\usr\bin\curl.exe https://dlang.org/install.sh | \msys64\usr\bin\bash.exe -s
    

    This process will end with a message showing the location of activate.bat, which can be used to add the installed compiler to your PATH.

    The script itself will also be installed locally. This will show you its other uses:

    C:\msys64\usr\bin\bash.exe %USERPROFILE%\dlang\install.sh --help
    

Dub changes

  1. Dub root package target environment variables added

    Environment variables DUB_ROOT_PACKAGE_TARGET_TYPE, DUB_ROOT_PACKAGE_TARGET_PATH and DUB_ROOT_PACKAGE_TARGET_NAME have been added and exposed.

  2. Improved CLI extensibility

    The code from the runDubCommandLine was moved to some other structs. The new CommandLineHandler structure takes care of the CLI state and commands, which allows DUB commands to be extended in other projects.

    The CommandArgs class now has new hasAppArgs and appArgs methods which allows you to get the app arguments. In addition, the extractAllRemainingArgs method will return all unused arguments and the app arguments.


List of all bug fixes and enhancements in D 2.093.0:

Contributors to this release (54)

A huge thanks goes to all the awesome people who made this release possible.

previous version: 2.092.1