www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Beta 2.103.0

reply Iain Buclaw <ibuclaw gdcproject.org> writes:
Glad to announce the first beta for the 2.103.0 release, ♥ to the 
43 contributors.

This release comes with 9 major changes, including:

- In the compiler, `-preview=dip25` is now enabled by default.
- In the standard library, std.uni Grapheme functions have been 
updated to conform to Unicode 15
- In dub, the `--color` argument now accepts the values `auto`, 
`never`, and `always`.

http://dlang.org/download.html#dmd_beta
http://dlang.org/changelog/2.103.0.html

As usual please report any bugs at https://issues.dlang.org

-Iain
on behalf of the Dlang Core Team
Mar 02 2023
next sibling parent reply ryuukk_ <ryuukk.dev gmail.com> writes:
On Thursday, 2 March 2023 at 14:40:04 UTC, Iain Buclaw wrote:
 Glad to announce the first beta for the 2.103.0 release, ♥ to 
 the 43 contributors.

 This release comes with 9 major changes, including:

 - In the compiler, `-preview=dip25` is now enabled by default.
 - In the standard library, std.uni Grapheme functions have been 
 updated to conform to Unicode 15
 - In dub, the `--color` argument now accepts the values `auto`, 
 `never`, and `always`.

 http://dlang.org/download.html#dmd_beta
 http://dlang.org/changelog/2.103.0.html

 As usual please report any bugs at https://issues.dlang.org

 -Iain
 on behalf of the Dlang Core Team
```D safe ref int wrongIdentity(ref int x) { return x; // ERROR! Cannot return a ref, please use "return ref" } safe ref int identity(return ref int x) { return x; // fine } ``` a keyword to return a value ``return 5;`` and a keyword to tell that a reference is returnable ``return ref int x`` that's dumb, why?
Mar 02 2023
next sibling parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Thursday, 2 March 2023 at 15:56:35 UTC, ryuukk_ wrote:
 On Thursday, 2 March 2023 at 14:40:04 UTC, Iain Buclaw wrote:
 Glad to announce the first beta for the 2.103.0 release, ♥ to 
 the 43 contributors.

 This release comes with 9 major changes, including:

 - In the compiler, `-preview=dip25` is now enabled by default.
 - In the standard library, std.uni Grapheme functions have 
 been updated to conform to Unicode 15
 - In dub, the `--color` argument now accepts the values 
 `auto`, `never`, and `always`.

 http://dlang.org/download.html#dmd_beta
 http://dlang.org/changelog/2.103.0.html

 As usual please report any bugs at https://issues.dlang.org

 -Iain
 on behalf of the Dlang Core Team
```D safe ref int wrongIdentity(ref int x) { return x; // ERROR! Cannot return a ref, please use "return ref" } safe ref int identity(return ref int x) { return x; // fine } ``` a keyword to return a value ``return 5;`` and a keyword to tell that a reference is returnable ``return ref int x`` that's dumb, why?
return ref is probably the tipping point for me. Even if better keyword is used the accrual of complexity never ends. Though arguably transitive qualifiers and inout were the point of no return. Recently I had a case where in 64-bit mode a data-structure could be implicitly converted to immutable while in 32-bit it wouldn’t. After some mucking around a seemingly unrelated change fixed it, the error message gave no clue of what’s wrong. Anyway I’d have a hard time selling transitive qualifiers in particular shared, as most of the time shared object is taken off the queue and should become thread-local. The type system doesn’t want to hear any of it. Seems like ownership system beats transitive qualifiers here, albeit both add significant friction. — Dmitry Olshansky
Mar 02 2023
prev sibling parent Dukc <ajieskola gmail.com> writes:
On Thursday, 2 March 2023 at 15:56:35 UTC, ryuukk_ wrote:
 ```D
  safe ref int wrongIdentity(ref int x) {
     return x; // ERROR! Cannot return a ref, please use "return 
 ref"
 }
  safe ref int identity(return ref int x) {
     return x; // fine
 }
 ```
 a keyword to return a value

 ``return 5;``

 and a keyword to tell that a reference is returnable

 ``return ref int x``

 that's dumb, why?
Late answer, but it happens because DIP25 is now the default. `ref` without `return` means that the return value cannot refer to the parameter in question. You can alternatively fix this by turning function attribute inference on, by omitting `int` from the function header. Why DIP25 is needed? Consider this: ```D int* pointer1; int* pointer2; safe ref int incrementAndCopy(ref int x) { return *new int(x++); } safe unittest { int local = 0; pointer1 = &local.identity; pointer2 = &incrementAndCopy(local); } ``` The compiler must prevent the first assignment to `pointer`, because otherwise it would end up pointing to an expired stack variable. On the other hand, we don't want to disallow harmless usage of `ref` like that of the `incrementAndCopy` call in the second assignment. To achieve that, the compiler needs to distinguish between `ref` variables that may be referenced to by the return value, and those that cannot. Plain `ref` means it can not, `return ref` means it can.
Mar 23 2023
prev sibling next sibling parent reply jmh530 <john.michael.hall gmail.com> writes:
On Thursday, 2 March 2023 at 14:40:04 UTC, Iain Buclaw wrote:
 Glad to announce the first beta for the 2.103.0 release, ♥ to 
 the 43 contributors.

 [snip]
I see some typos in the changelog (stars around what I noticed): Up until this release, D had both traits(isVirtualFunction) and traits(isVirtualMethod) (and their *coressponding* traits(get...) counterpart). The *differenrcte* between the two is that isVirtualFunction returns true for final methods that do not override anything. As the template constraint is not used to overload the symbol template function, the *constrains* are *move* into static asserts with expressive error messages.
 - In dub, the `--color` argument now accepts the values `auto`, 
 `never`, and `always`.
Any reason why it doesn't match the options from DMD? I recall some discussion about how to get the colors working on Windows, but it's been a long time and hard to find. It might be good to add something like "Here's an example on Windows 1X" to https://dlang.org/dmd-windows.html
Mar 02 2023
next sibling parent jmh530 <john.michael.hall gmail.com> writes:
On Thursday, 2 March 2023 at 16:40:12 UTC, jmh530 wrote:
 On Thursday, 2 March 2023 at 14:40:04 UTC, Iain Buclaw wrote:
 Glad to announce the first beta for the 2.103.0 release, ♥ to 
 the 43 contributors.

 [snip]
I see some typos in the changelog (stars around what I noticed): [snip]
I guess with markdown, the stars became italics
Mar 02 2023
prev sibling parent reply Bastiaan Veelo <Bastiaan Veelo.net> writes:
On Thursday, 2 March 2023 at 16:40:12 UTC, jmh530 wrote:
 Any reason why it doesn't match the options from DMD?
See the [changelog](https://dlang.org/changelog/2.103.0.html#colors):
 The previous **automatic**, **on**, **off** values are still 
 supported, but undocumented, because they are used in almost no 
 other program like this. For consistency, with other Linux 
 tools especially, we have implemented and switched the defaults 
 to the widely-used **auto**, **never**, **always** values.
Mar 02 2023
parent jmh530 <john.michael.hall gmail.com> writes:
On Thursday, 2 March 2023 at 18:35:36 UTC, Bastiaan Veelo wrote:
 On Thursday, 2 March 2023 at 16:40:12 UTC, jmh530 wrote:
 Any reason why it doesn't match the options from DMD?
See the [changelog](https://dlang.org/changelog/2.103.0.html#colors):
 The previous **automatic**, **on**, **off** values are still 
 supported, but undocumented, because they are used in almost 
 no other program like this. For consistency, with other Linux 
 tools especially, we have implemented and switched the 
 defaults to the widely-used **auto**, **never**, **always** 
 values.
Thanks. I must have missed that...
Mar 02 2023
prev sibling parent reply Iain Buclaw <ibuclaw gdcproject.org> writes:
On Thursday, 2 March 2023 at 14:40:04 UTC, Iain Buclaw wrote:
 Glad to announce the first beta for the 2.103.0 release
The release candidate for 2.103.0 is now available, which has 11 bug fixes since the initial beta release. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.103.0.html As usual please report any bugs at https://issues.dlang.org -Iain on behalf of the Dlang Core Team
Mar 16 2023
parent M.M. <matus email.cz> writes:
On Thursday, 16 March 2023 at 09:13:04 UTC, Iain Buclaw wrote:
 On Thursday, 2 March 2023 at 14:40:04 UTC, Iain Buclaw wrote:
 ...
 The release candidate for 2.103.0 is now available, which has 
 11 bug fixes since the initial beta release.
 ...
Good to hear the beta was useful.
Mar 16 2023