May 24, 2022
On 5/24/2022 6:13 AM, deadalnix wrote:
> On Tuesday, 24 May 2022 at 05:39:50 UTC, Walter Bright wrote:
>> On 5/22/2022 6:31 AM, deadalnix wrote:
>>> https://issues.dlang.org/show_bug.cgi?id=1983
>>
>> It's been fixed already. Just nobody closed it.
> 
> No.

Yes, the issue that opened the bugzilla is fixed.

> 
> ```d
> struct S {
>      void delegate() dg;
> }
> 
> void main() {
>      int x = 42;
>      immutable S s = { dg: () { x++; } };
>      s.dg();
> 
>      import std.stdio;
>      writeln(x);
> }
> ```
> 
> This still compiles and run and mutates a variable through an immutable pointer. This variable could be shared too because immutable is safe to share.

Other problems should get their own bugzilla. (Otherwise bugzilla becomes unmanageable.)
May 24, 2022

On Tuesday, 24 May 2022 at 15:31:47 UTC, Adam D Ruppe wrote:

>

On Tuesday, 24 May 2022 at 15:15:13 UTC, FeepingCreature wrote:

>

Javascript, yes:

If you use var, the variable is hoisted to the top-level scope of the function, so this behavior is then expected.

Use the let keyword for a local lexically scope thing, and then you'll see the cb behavior is different.

Oh, I see!

May 24, 2022
On Tuesday, 24 May 2022 at 16:21:45 UTC, Walter Bright wrote:
>> 
>> ```d
>> struct S {
>>      void delegate() dg;
>> }
>> 
>> void main() {
>>      int x = 42;
>>      immutable S s = { dg: () { x++; } };
>>      s.dg();
>> 
>>      import std.stdio;
>>      writeln(x);
>> }
>> ```
>> 
>> This still compiles and run and mutates a variable through an immutable pointer. This variable could be shared too because immutable is safe to share.
>
> Other problems should get their own bugzilla. (Otherwise bugzilla becomes unmanageable.)

It is the same problem. There are example similar to this one in the issue. At some point, you'll have to decide if you want to fix these issues or if you want to massage things in a way a couple of test case passes, but which don't solve anything.
May 24, 2022
On 5/24/2022 12:45 AM, Timon Gehr wrote:
> No. The correct behavior when a delegate literal outlives captured variables is to allocate a closure. This case is not an exception...

But it isn't a safety problem, as it won't compile.
May 24, 2022
On 5/24/2022 6:34 AM, deadalnix wrote:
> but this is because in python, variable scope is always the top level in the function.

Cheaters.

Scoped variables are a good thing.

May 24, 2022
On 5/24/2022 6:21 AM, deadalnix wrote:
> The worse offender as far as I can tell is random feature added. They break all kind of tooling, every time.

Everybody asks for bug fixes only, and btw add feature X.

May 24, 2022
On 5/24/2022 2:58 AM, IGotD- wrote:
> Right now people in the D project don't even know what to do or implement. 

They can visit bugzilla, pick anything open, and work on it.

> Should D have co-routines or should async/await be implemented? Then we need a document that explains to everybody what needs to be implemented so people can go pick a certain work package they want to implement.

I've suggested many times that someone should work on async/await. You're free to contribute there, too.
May 24, 2022
On 5/24/2022 3:43 AM, Dennis wrote:
> That's the opposite of what happened. You kicked off the implementation around March 2021:
> https://github.com/dlang/dmd/pulls?q=is%3Aclosed+is%3Apr+author%3Awalterbright+DIP1034 

I stand corrected.
May 24, 2022

On Tuesday, 24 May 2022 at 13:13:01 UTC, FeepingCreature wrote:

>

Fully agreed, but don't underestimate how magical DMD's performance is. I wish neat's compiler was as speedy.

Nowadays I find that IDE semantic analysis performance is most important. I am getting used to fixing bugs before compilation.

Designing the language so that static analysis can be cached might become the holy grail of development speed... tricky issue to think about though. Might limit lookup strategies...

May 24, 2022
On 5/24/2022 9:40 AM, deadalnix wrote:
> It is the same problem. There are example similar to this one in the issue. At some point, you'll have to decide if you want to fix these issues or if you want to massage things in a way a couple of test case passes, but which don't solve anything.

Sometimes the same problem can exhibit very different symptoms and wind up with multiple distinct bug reports.

Sometimes problems that look similar have very different causes. I've often encountered the latter in one issue and wound up splitting them into multiple issues.

Which is which is unknowable without finding the source of each problem.

Since github works best with a 1:1 matching of bug report with fix, this is the most productive way to go about it.

Anyhow, this is not worth arguing about, so I created this:

https://issues.dlang.org/show_bug.cgi?id=23134
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18