Change Log: 2.093.0
Download D 2.093.0 Beta
to be released Jul 01, 2020
Compiler changes
Runtime changes
Installer changes
List of all bug fixes and enhancements in D 2.093.0.
Compiler changes
- 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.
- 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 { }
- 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; }
- 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
- 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
- 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.
- 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"); }
- 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
- 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
- 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.
- 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 (53)
A huge thanks goes to all the awesome people who made this release possible.
- Adam D. Ruppe
- aG0aep6G
- Alexandru Militaru
- Andrei Alexandrescu
- Anton Oks
- Atila Neves
- Bastiaan Veelo
- Ben Jones
- blackbird
- Boris Carvajal
- BthereDthat
- Cristian Creteanu
- Denis Feklushkin
- dkorpel
- drug007
- Ernesto Castellotti
- Florian
- guai
- Hiroki Noda
- Iain Buclaw
- Jacob Carlborg
- John Colvin
- Kazuya Takahashi
- Luhrel
- Manu Evans
- Martin Kinkelin
- Martin Nowak
- Mathias Lang
- Mathis Beer
- Mike Parker
- MoonlightSentinel
- Nathan Sashihara
- Nicholas Wilson
- Nick Treleaven
- Nils Lankila
- Patrick Schlüter
- Paul Backus
- Per Nordlöw
- Petar Kirov
- Pierre Grimaud
- Rainer Schuetze
- Razvan Nitu
- Sebastian Wilzbach
- Sergei Akhmatdinov
- Simen Kjærås
- Steven Schveighoffer
- Tomoya Tanjo
- Vladimir Panteleev
- Walter Bright
- Walter Waldron
- welkam
- Witold Baryluk
- wolframw