September 08, 2021

On Wednesday, 8 September 2021 at 11:30:48 UTC, Mike Parker wrote:

>

On Wednesday, 8 September 2021 at 08:27:13 UTC, Tejas wrote:

>

And what I'm saying is that the user doesn't know that they're getting a temporary unless they're aware that structs are value types. And in this particular case, opAssign isn't defined.

So I personally think this warrants a warning at the very least.

Then the thing to do would be to open an issue in Bugzilla for an enhancement request and see what comes of it:

https://issues.dlang.org/

Done

https://issues.dlang.org/show_bug.cgi?id=22290

September 08, 2021

On Wednesday, 8 September 2021 at 08:32:01 UTC, bauss wrote:

>

On Wednesday, 8 September 2021 at 07:51:29 UTC, drug wrote:

>

[...]

You're entirely right. The problem isn't the language at all. The problems are all the politic issues that exist. It has existed for D since early days, like how the community was split up with tango.

The language is fairly stable and can be used for almost anything, while library support isn't the greatest then it's not bad either.

However the politic issues are so terrible and while it has been worse then there's still so many improvements to be made.

However even with the improvements then it won't fix the past issues.

Some resolved political issues still remain outside of the community, because others still think they're relevant like people still thinking there are two standard libraries etc.

Although I have known about D since ~2018, I only started actively visiting the forums and actually using it a little since June this year.

What political issues are you talking about?

September 08, 2021

On Tuesday, 7 September 2021 at 13:36:39 UTC, Tejas wrote:

>

On Tuesday, 7 September 2021 at 08:46:48 UTC, Basile B. wrote:

>

On Tuesday, 7 September 2021 at 05:01:30 UTC, Tejas wrote:

>

On Tuesday, 7 September 2021 at 01:34:01 UTC, Basile B. wrote:

>

[...]

Don't you think it would be better to raise a warning though instead of silently fixing it?

no. as compiler experiment people can add a flag to generated temproaries and then printf on a visitor for VarExp and then will probabably be surprised by the amount of message printf'd like 2567 times

"look boy am saving expressivity for ya here"

>

It would help people understand the differences between [...]

import std.stdio;

struct S { int i; }

S _s;

S s (){return _s;}

void main()
{
    s().i = 42;
    writeln(_s.i == 42);
}

Output:
false

Wow, compiler help much appreciated

I see that the conversation has forked on the validity of this kind of code, so I've should have chosen a better example (set i storage to __gshared). The point was just to show that tempraries a created.

September 08, 2021

On Wednesday, 8 September 2021 at 12:12:57 UTC, Tejas wrote:

>

On Wednesday, 8 September 2021 at 08:32:01 UTC, bauss wrote:

>

On Wednesday, 8 September 2021 at 07:51:29 UTC, drug wrote:

>

[...]

You're entirely right. The problem isn't the language at all. The problems are all the politic issues that exist. It has existed for D since early days, like how the community was split up with tango.

The language is fairly stable and can be used for almost anything, while library support isn't the greatest then it's not bad either.

However the politic issues are so terrible and while it has been worse then there's still so many improvements to be made.

However even with the improvements then it won't fix the past issues.

Some resolved political issues still remain outside of the community, because others still think they're relevant like people still thinking there are two standard libraries etc.

Although I have known about D since ~2018, I only started actively visiting the forums and actually using it a little since June this year.

What political issues are you talking about?

People disagreeing with the future of the language, its design, standard library and management in general.

There was a huge discussion recently due to some PR or something being reverted and people took sides on whether they agreed/disagreed with that.

Some contributors even left because of it.

And it's not something new, as it has happened many times before.

There were used to be a split about the standard library too, where there existed 2 "standard" libraries.

One official and then tango (which of course is somewhat discontinued and has been for years) - which separated the whole community into two groups, those who used tango and those who didn't and often code using phobos couldn't be used with code that used tango.

That's no longer an issue but you'll still once in a while hear people bring it up as if it's a current issue.

There are many more.

Personally I don't care much about all these issues but I've seen them hurt the community over all so many times.

September 08, 2021

On Wednesday, 8 September 2021 at 12:28:13 UTC, Basile B. wrote:

>

On Tuesday, 7 September 2021 at 13:36:39 UTC, Tejas wrote:

>

On Tuesday, 7 September 2021 at 08:46:48 UTC, Basile B. wrote:

>

On Tuesday, 7 September 2021 at 05:01:30 UTC, Tejas wrote:

>

On Tuesday, 7 September 2021 at 01:34:01 UTC, Basile B. wrote:

>

[...]

Don't you think it would be better to raise a warning though instead of silently fixing it?

no. as compiler experiment people can add a flag to generated temproaries and then printf on a visitor for VarExp and then will probabably be surprised by the amount of message printf'd like 2567 times

"look boy am saving expressivity for ya here"

>

It would help people understand the differences between [...]

import std.stdio;

struct S { int i; }

S _s;

S s (){return _s;}

void main()
{
    s().i = 42;
    writeln(_s.i == 42);
}

Output:
false

Wow, compiler help much appreciated

I see that the conversation has forked on the validity of this kind of code, so I've should have chosen a better example (set i storage to __gshared). The point was just to show that tempraries a created.

And I was arguing that that behavior should be either disabled(I don't feel this way anymore) or at least emit a warning(still feel this way).

This isn't the first time, apparently:

https://issues.dlang.org/show_bug.cgi?id=3008

Even more troubling is this one, where auto decides to return struct by value rather than reference:
https://issues.dlang.org/show_bug.cgi?id=15231

The second one is more serious, I think.
No matter the default option picked by auto, it'll always be wrong in the other context.

September 08, 2021

On Wednesday, 8 September 2021 at 13:25:44 UTC, bauss wrote:

>

On Wednesday, 8 September 2021 at 12:12:57 UTC, Tejas wrote:

>

[...]

People disagreeing with the future of the language, its design, standard library and management in general.

There was a huge discussion recently due to some PR or something being reverted and people took sides on whether they agreed/disagreed with that.

Some contributors even left because of it.

And it's not something new, as it has happened many times before.

There were used to be a split about the standard library too, where there existed 2 "standard" libraries.

One official and then tango (which of course is somewhat discontinued and has been for years) - which separated the whole community into two groups, those who used tango and those who didn't and often code using phobos couldn't be used with code that used tango.

That's no longer an issue but you'll still once in a while hear people bring it up as if it's a current issue.

There are many more.

Personally I don't care much about all these issues but I've seen them hurt the community over all so many times.

That's the problem of being pure open source and community driven, I guess...

It sucks, but I agree with Mike when he says that the fact we have gotten this far is a marvel.

Here's to hoping a future D3 will get rid of these problems forever!!

1 2 3 4 5
Next ›   Last »