www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Release D 2.089.0

reply Martin Nowak <code+news.digitalmars dawg.eu> writes:
Glad to announce D 2.089.0, ♥ to the 44 contributors.

This release comes with corrected extern(C) mangling in mixin templates, 
atomicFetchAdd and atomicFetchSub in core.atomic, support for link 
driver arguments, better support of LDC in dub, and plenty of other bug 
fixes and improvements.

http://dlang.org/download.html
http://dlang.org/changelog/2.089.0.html

-Martin
Nov 03 2019
next sibling parent reply John Chapman <johnch_atms hotmail.com> writes:
On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote:
 Glad to announce D 2.089.0, ♥ to the 44 contributors.

 This release comes with corrected extern(C) mangling in mixin 
 templates, atomicFetchAdd and atomicFetchSub in core.atomic, 
 support for link driver arguments, better support of LDC in 
 dub, and plenty of other bug fixes and improvements.

 http://dlang.org/download.html
 http://dlang.org/changelog/2.089.0.html

 -Martin
Something has changed with core.atomic.cas - it used to work with `null` as the `ifThis` argument, now it throws an AV. Is this intentional? If I use `cast(shared)null` it doesn't throw but if the change was deliberate shouldn't it be mentioned?
Nov 04 2019
parent reply Manu <turkeyman gmail.com> writes:
On Mon., 4 Nov. 2019, 2:05 am John Chapman via Digitalmars-d-announce, <
digitalmars-d-announce puremagic.com> wrote:

 On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote:
 Glad to announce D 2.089.0, =E2=99=A5 to the 44 contributors.

 This release comes with corrected extern(C) mangling in mixin
 templates, atomicFetchAdd and atomicFetchSub in core.atomic,
 support for link driver arguments, better support of LDC in
 dub, and plenty of other bug fixes and improvements.

 http://dlang.org/download.html
 http://dlang.org/changelog/2.089.0.html

 -Martin
Something has changed with core.atomic.cas - it used to work with `null` as the `ifThis` argument, now it throws an AV. Is this intentional? If I use `cast(shared)null` it doesn't throw but if the change was deliberate shouldn't it be mentioned?
Changes were made because there were a lot of problems with that module... but the (reasonably comprehensive) unit tests didn't reveal any such regressions. We also build+test many popular OSS projects via buildkite, and there weren't problems. Can you show the broken code?

Nov 04 2019
parent reply John Chapman <johnch_atms hotmail.com> writes:
On Tuesday, 5 November 2019 at 06:44:29 UTC, Manu wrote:
 On Mon., 4 Nov. 2019, 2:05 am John Chapman via 
 Digitalmars-d-announce, < digitalmars-d-announce puremagic.com> 
 wrote:

 Something has changed with core.atomic.cas - it used to work 
 with `null` as the `ifThis` argument, now it throws an AV. Is 
 this intentional?

 If I use `cast(shared)null` it doesn't throw but if the change 
 was deliberate shouldn't it be mentioned?
Changes were made because there were a lot of problems with that module... but the (reasonably comprehensive) unit tests didn't reveal any such regressions. We also build+test many popular OSS projects via buildkite, and there weren't problems. Can you show the broken code?
Sure - this AVs on DMD 2.088 Windows: import core.atomic; void main() { Object a, b = new Object; cas(cast(shared)&a, null, cast(shared)b); }
Nov 04 2019
next sibling parent John Chapman <johnch_atms hotmail.com> writes:
On Tuesday, 5 November 2019 at 07:52:12 UTC, John Chapman wrote:
 Sure - this AVs on DMD 2.088 Windows:

 import core.atomic;
 void main() {
   Object a, b = new Object;
   cas(cast(shared)&a, null, cast(shared)b);
 }
Sorry, I meant it AVs 2.089, but works on 2.088.
Nov 04 2019
prev sibling next sibling parent reply Manu <turkeyman gmail.com> writes:
On Mon, Nov 4, 2019 at 11:55 PM John Chapman via
Digitalmars-d-announce <digitalmars-d-announce puremagic.com> wrote:
 On Tuesday, 5 November 2019 at 06:44:29 UTC, Manu wrote:
 On Mon., 4 Nov. 2019, 2:05 am John Chapman via
 Digitalmars-d-announce, < digitalmars-d-announce puremagic.com>
 wrote:

 Something has changed with core.atomic.cas - it used to work
 with `null` as the `ifThis` argument, now it throws an AV. Is
 this intentional?

 If I use `cast(shared)null` it doesn't throw but if the change
 was deliberate shouldn't it be mentioned?
Changes were made because there were a lot of problems with that module... but the (reasonably comprehensive) unit tests didn't reveal any such regressions. We also build+test many popular OSS projects via buildkite, and there weren't problems. Can you show the broken code?
Sure - this AVs on DMD 2.088 Windows: import core.atomic; void main() { Object a, b = new Object; cas(cast(shared)&a, null, cast(shared)b); }
Oh... a class. Yeah, that's an interesting case that I actually noted had a low testing surface area. It's also theoretically broken; despite what's practical, I think it's improperly spec-ed that shared classes can be used with atomics. With a struct, you can declare `shared(T)* s_ptr`, but with classes you can only `shared(C) c_ptr`, where the difference is that `s_ptr` can be read/written... but `c_ptr` is typed such that the pointer itself is shared (because classes are implicitly a pointer), so that `c_ptr` can't be safely read/write-able... So, I actually think that atomic API is mal-formed, and it should not support `shared` arguments, but I tried to preserve existing behaviour, while being more strict about what is valid. I obviously missed something with `null` here. Incidentally, in your sample above there, `a` and `b` are not shared... why not just write: `cas(&a, null, b);` ?? If source data is not shared, you shouldn't cast to shared.
Nov 05 2019
next sibling parent reply John Chapman <johnch_atms hotmail.com> writes:
On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote:
 Incidentally, in your sample above there, `a` and `b` are not 
 shared... why not just write: `cas(&a, null, b);` ?? If source 
 data is not shared, you shouldn't cast to shared.
Because casts were needed in 2.088 and earlier and I just updated to 2.089, unaware of the API change. Should I log `null` not working as a bug?
Nov 05 2019
next sibling parent Manu <turkeyman gmail.com> writes:
On Tue, Nov 5, 2019 at 1:20 PM John Chapman via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote:
 Incidentally, in your sample above there, `a` and `b` are not
 shared... why not just write: `cas(&a, null, b);` ?? If source
 data is not shared, you shouldn't cast to shared.
Because casts were needed in 2.088 and earlier and I just updated to 2.089, unaware of the API change. Should I log `null` not working as a bug?
Yes
Nov 05 2019
prev sibling parent reply Manu <turkeyman gmail.com> writes:
On Tue, Nov 5, 2019 at 5:14 PM Manu <turkeyman gmail.com> wrote:
 On Tue, Nov 5, 2019 at 1:20 PM John Chapman via Digitalmars-d-announce
 <digitalmars-d-announce puremagic.com> wrote:
 On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote:
 Incidentally, in your sample above there, `a` and `b` are not
 shared... why not just write: `cas(&a, null, b);` ?? If source
 data is not shared, you shouldn't cast to shared.
Because casts were needed in 2.088 and earlier and I just updated to 2.089, unaware of the API change. Should I log `null` not working as a bug?
Yes
But I also think you should update your code to not perform the casts. Can you confirm that the null works when removing the shared casts?
Nov 05 2019
parent reply John Chapman <johnch_atms hotmail.com> writes:
On Wednesday, 6 November 2019 at 01:16:00 UTC, Manu wrote:
 On Tue, Nov 5, 2019 at 5:14 PM Manu <turkeyman gmail.com> wrote:
 On Tue, Nov 5, 2019 at 1:20 PM John Chapman via 
 Digitalmars-d-announce <digitalmars-d-announce puremagic.com> 
 wrote:
 On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote:
 Incidentally, in your sample above there, `a` and `b` are 
 not shared... why not just write: `cas(&a, null, b);` ?? 
 If source data is not shared, you shouldn't cast to shared.
Because casts were needed in 2.088 and earlier and I just updated to 2.089, unaware of the API change. Should I log `null` not working as a bug?
Yes
But I also think you should update your code to not perform the casts. Can you confirm that the null works when removing the shared casts?
Yes and no - it compiles when removing the casts, but AVs at runtime. Bug filed: https://issues.dlang.org/show_bug.cgi?id=20359
Nov 05 2019
parent Manu <turkeyman gmail.com> writes:
On Tue., 5 Nov. 2019, 11:35 pm John Chapman via Digitalmars-d-announce, <
digitalmars-d-announce puremagic.com> wrote:

 On Wednesday, 6 November 2019 at 01:16:00 UTC, Manu wrote:
 On Tue, Nov 5, 2019 at 5:14 PM Manu <turkeyman gmail.com> wrote:
 On Tue, Nov 5, 2019 at 1:20 PM John Chapman via
 Digitalmars-d-announce <digitalmars-d-announce puremagic.com>
 wrote:
 On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote:
 Incidentally, in your sample above there, `a` and `b` are
 not shared... why not just write: `cas(&a, null, b);` ??
 If source data is not shared, you shouldn't cast to shared.
Because casts were needed in 2.088 and earlier and I just updated to 2.089, unaware of the API change. Should I log `null` not working as a bug?
Yes
But I also think you should update your code to not perform the casts. Can you confirm that the null works when removing the shared casts?
Yes and no - it compiles when removing the casts, but AVs at runtime. Bug filed: https://issues.dlang.org/show_bug.cgi?id=20359
Thanks! I'll look into these as soon as I have a moment. Sorry for the inconvenience.
Nov 06 2019
prev sibling next sibling parent Heromyth <bitworld qq.com> writes:
On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote:
 On Mon, Nov 4, 2019 at 11:55 PM John Chapman via 
 Digitalmars-d-announce <digitalmars-d-announce puremagic.com> 
 wrote:
 [...]
[...]
The keyword of share is really annoying for a class。
Nov 05 2019
prev sibling parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 11/5/19 2:05 PM, Manu wrote:
 Incidentally, in your sample above there, `a` and `b` are not
 shared... why not just write: `cas(&a, null, b);` ?? If source data is
 not shared, you shouldn't cast to shared.
We have the same problem in Martin's std.io library, won't build with the null uncasted. And it's not improperly casting, because syncDriver is stateless and immutable, so casting to shared mutable isn't going to cause problems (I think). https://github.com/MartinNowak/io/blob/2147802a9bca0dcf82293303f407dd3e253691e9/src/std/io/driver/package.d#L232-L250 Discussion: https://github.com/MartinNowak/io/issues/27 Currently causes pull requests for this and my iopipe library to fail to build on CI. P.S. glad to see shared getting some attention! -Steve
Nov 06 2019
prev sibling parent reply Heromyth <bitworld qq.com> writes:
On Tuesday, 5 November 2019 at 07:52:12 UTC, John Chapman wrote:
 On Tuesday, 5 November 2019 at 06:44:29 UTC, Manu wrote:
 On Mon., 4 Nov. 2019, 2:05 am John Chapman via 
 Digitalmars-d-announce, < 
 digitalmars-d-announce puremagic.com> wrote:

[...]
Changes were made because there were a lot of problems with that module... but the (reasonably comprehensive) unit tests didn't reveal any such regressions. We also build+test many popular OSS projects via buildkite, and there weren't problems. Can you show the broken code?
Sure - this AVs on DMD 2.088 Windows: import core.atomic; void main() { Object a, b = new Object; cas(cast(shared)&a, null, cast(shared)b); }
There are some bugs in cas. See here: https://issues.dlang.org/show_bug.cgi?id=20354 https://issues.dlang.org/show_bug.cgi?id=20355
Nov 05 2019
parent jmh530 <john.michael.hall gmail.com> writes:
On Wednesday, 6 November 2019 at 01:51:24 UTC, Heromyth wrote:
 [snip]

 There are some bugs in cas. See here:
 https://issues.dlang.org/show_bug.cgi?id=20354
 https://issues.dlang.org/show_bug.cgi?id=20355
I suspect that providing simplified examples might improve your chances of getting these fixed...
Nov 06 2019
prev sibling next sibling parent reply Ron Tarrant <rontarrant gmail.com> writes:
On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote:
 Glad to announce D 2.089.0...
Hi Martin, On the one hand, it's nice to get a shiny, new version (thanks to all involved), but is there any way the installer can be more selective about what it tosses out so I don't have to reconfigure GtkD libs, etc. in its aftermath?
Nov 06 2019
parent reply Mike Parker <aldacron gmail.com> writes:
On Wednesday, 6 November 2019 at 13:49:16 UTC, Ron Tarrant wrote:

 On the one hand, it's nice to get a shiny, new version (thanks 
 to all involved), but is there any way the installer can be 
 more selective about what it tosses out so I don't have to 
 reconfigure GtkD libs, etc. in its aftermath?
Are you putting libs in the compiler's directory tree? Or are you editing sc.ini/dmd.conf? You really shouldn't be doing the former.
Nov 06 2019
parent reply Ron Tarrant <rontarrant gmail.com> writes:
On Wednesday, 6 November 2019 at 14:09:35 UTC, Mike Parker wrote:

 Are you putting libs in the compiler's directory tree? Or are 
 you editing sc.ini/dmd.conf? You really shouldn't be doing the 
 former.
I follow the steps outlined here: https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows the compiler's directory tree. Is that what you mean by "You really shouldn't be doing the former."? And I also edit sc.ini.
Nov 07 2019
next sibling parent Jacob Carlborg <doob me.com> writes:
On Thursday, 7 November 2019 at 10:25:46 UTC, Ron Tarrant wrote:

 I follow the steps outlined here: 
 https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows


 the compiler's directory tree. Is that what you mean by "You 
 really shouldn't be doing the
 former."?

 And I also edit sc.ini.
I recommend that you use Dub instead and add gtk-d [1] as a dependency. [1] https://code.dlang.org/packages/gtk-d -- /Jacob Carlborg
Nov 07 2019
prev sibling parent Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
On Thursday, November 7, 2019 3:25:46 AM MST Ron Tarrant via Digitalmars-d-
announce wrote:
 On Wednesday, 6 November 2019 at 14:09:35 UTC, Mike Parker wrote:
 Are you putting libs in the compiler's directory tree? Or are
 you editing sc.ini/dmd.conf? You really shouldn't be doing the
 former.
I follow the steps outlined here: https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows the compiler's directory tree. Is that what you mean by "You really shouldn't be doing the former."? And I also edit sc.ini.
You should pretty much never put anything in the compiler's directory tree, and there's no need to. If you're editing the sc.ini, you might as well just put your external libraries somewhere else and have sc.ini point to them there. Putting code in a directory that the installer manages provides no benefit while causing problems like the installer deleting it when updating. In most cases though, the recommended thing to do is to just use dub rather than manually mucking around with sc.ini or dmd.conf. This reminds me of someone complaining that they couldn't just unzip the dmd install on top of another and have it work (their code no longer compiled aftery they'd just unzipped a release of dmd/phobos which had a split std.datetime on top of one that didn't). - Jonathan M Davis
Nov 11 2019
prev sibling next sibling parent Mike Parker <aldacron gmail.com> writes:
On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote:
 Glad to announce D 2.089.0, ♥ to the 44 contributors.
The Blog: https://dlang.org/blog/2019/11/06/dmd-2-089-0-released/ Reddit: https://www.reddit.com/r/programming/comments/dsgrc2/d_20890_released/
Nov 06 2019
prev sibling parent reply Andrea Fontana <nospam example.com> writes:
On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote:
 Glad to announce D 2.089.0, ♥ to the 44 contributors.

 This release comes with corrected extern(C) mangling in mixin 
 templates, atomicFetchAdd and atomicFetchSub in core.atomic, 
 support for link driver arguments, better support of LDC in 
 dub, and plenty of other bug fixes and improvements.

 http://dlang.org/download.html
 http://dlang.org/changelog/2.089.0.html

 -Martin
My code hit a regression on 2.089. This worked fine, before dmd 2.089 (reduced): mixin Bug!"asd"; enum test; template Bug(string n) { int main() { import std; foreach(name; __traits(allMembers, __traits(parent, main))) static if (hasUDA!(__traits(getMember, __traits(parent, main), name), test)) return 0; return 0; } }
Nov 07 2019
parent Andrea Fontana <nospam example.com> writes:
On Thursday, 7 November 2019 at 16:37:56 UTC, Andrea Fontana 
wrote:
 On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote:
 Glad to announce D 2.089.0, ♥ to the 44 contributors.

 This release comes with corrected extern(C) mangling in mixin 
 templates, atomicFetchAdd and atomicFetchSub in core.atomic, 
 support for link driver arguments, better support of LDC in 
 dub, and plenty of other bug fixes and improvements.

 http://dlang.org/download.html
 http://dlang.org/changelog/2.089.0.html

 -Martin
My code hit a regression on 2.089.
https://issues.dlang.org/show_bug.cgi?id=20368
Nov 08 2019