D 语言近些年一直在加紧脚步的开发迭代,改进语言本身的特性,增强易用性和其他语言的互通性,前面几个版本主要是针对 macOS 平台的 Objective-C 进行打通交互性,而一直努力的还有 C++ 标准库的打通,本次版本也对 C++ 的 std::string 和 std::vector 进行打通,进一步改善语言之间的交互性。
DLang 2.088.0 这个版本包含 27 个主要更改和 58 个已修复的Bugzilla问题。非常感谢 58 位贡献者使 2.088.0 成为可能。
编译器的变化
- D1 operator overloads have been deprecated.
- Deprecate allowing a constructor declaration in a static block
- deprecated now applies to alias this as well
- Double initialization of immutable fields inside constructor is now obsolete
- add __traits(getLocation, symbol)
- Suppress the "read-modify-write" error if type is a struct or a class
- Postblit and destructors are no longer called on members of anonymous unions.
运行时变化
- core.atomic : msync has been removed
- Added overloads for core.atomic.cas which don't discard their result.
- Added core.atomic.atomicExchange.
- Non-POSIX CLOCK enum members have been removed from core.sys.posix.time
- The druntime option callStructDtorsDuringGC has been deprecated.
- core.sys.posix.dlfcn : dladdr, dlvsym, Dl_info have been removed
- core.exception: Remove onHiddenFuncError / HiddenFuncError
- core.exception : setAssertHandler has been removed
- core.thread : Fiber.call(bool) has been removed
- Module core.sys.linux.sys.netinet.tcp has been removed
- core.runtime : Runtime.initialize, Runtime.terminate functions taking ExceptionHandler have been removed
- Added core.stdcpp.string.
- Added core.stdcpp.vector.
标准库变化
- std.array.Appender and RefAppender: use .opSlice() instead of data()
- ErrnoException.errno is now nothrow pure @nogc @safe
- Nullable alias get this has been deprecated
- Added the std.file.getAvailableDiskSpace functionality.
- Allow std.json to overlook trailing comma
安装器变化
- Bundled libcurl is now built with DONT_USE_RECV_BEFORE_SEND_WORKAROUND