August 16
On 16/08/2024 3:18 AM, Jonathan M Davis wrote:
> On Thursday, August 15, 2024 8:56:29 AM MDT Richard (Rikki) Andrew Cattermole
> via Digitalmars-d wrote:
>> On 16/08/2024 2:47 AM, Jonathan M Davis wrote:
>>> Either way, the person to convince would be Walter, and based on past
>>> discussions of this sort, I doubt that he'll be convinced, but who knows.
>>> It can sometimes be quite surprising what he does or doesn't agree with,
>>> and it's not like he never changes his mind.
>>
>> Considering that he allowed the abomination that is return and scope
>> ordering to result in two different attributes, it's worth talking with
>> him about it I'd say!
> 
> That is indeed an abomination, and I'd love to see that fixed (though
> honestly, I'd love to see DIP 1000 thrown out entirely), but it's a very
> different situation from const ref vs ref const. The problem with
> return scope vs scope return is that it not only makes the order matter, but
> it makes it so that each order means different things. On the other hand,
> requiring ref const would be requiring a fixed order when we have no need to
> do so, and both orders are currently fine.
> 
> - Jonathan M Davis

I'm currently writing up a proposal to replace DIP1000 in its entirety and yeah I got great joy from writing the grammar removal for it 2 hours ago!

August 15
On Thursday, 15 August 2024 at 15:20:59 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 16/08/2024 3:18 AM, Jonathan M Davis wrote:
>> On Thursday, August 15, 2024 8:56:29 AM MDT Richard (Rikki) Andrew Cattermole
>> via Digitalmars-d wrote:
>>> On 16/08/2024 2:47 AM, Jonathan M Davis wrote:
>>>> Either way, the person to convince would be Walter, and based on past
>>>> discussions of this sort, I doubt that he'll be convinced, but who knows.
>>>> It can sometimes be quite surprising what he does or doesn't agree with,
>>>> and it's not like he never changes his mind.
>>>
>>> Considering that he allowed the abomination that is return and scope
>>> ordering to result in two different attributes, it's worth talking with
>>> him about it I'd say!
>> 
>> That is indeed an abomination, and I'd love to see that fixed (though
>> honestly, I'd love to see DIP 1000 thrown out entirely), but it's a very
>> different situation from const ref vs ref const. The problem with
>> return scope vs scope return is that it not only makes the order matter, but
>> it makes it so that each order means different things. On the other hand,
>> requiring ref const would be requiring a fixed order when we have no need to
>> do so, and both orders are currently fine.
>> 
>> - Jonathan M Davis
>
> I'm currently writing up a proposal to replace DIP1000 in its entirety and yeah I got great joy from writing the grammar removal for it 2 hours ago!

I am trying to understand what is currently happening with D, and where it is going. It's extremely confusing. I see DIP1000 mentioned a lot, and was under the impression it had already been "accepted"? But now I see it is marked as "superseded"?? By what?

Someone briskly told me to stop using `in` because that's "buggy" or something, and I found [a comment from 2018](https://forum.dlang.org/thread/dkstvxwbcluncgllvypt@forum.dlang.org) (wow, 6 years ago?!) explaining that there's controversy on what that should actually mean (`const` VS `const scope`) and the current docs mention it's just `const` unless you use the `-preview=in` flag (so I guess it did end up meaning `const scope` but it's still hidden behind a flag, perhaps temporarily??)... and does `scope` do what DIP1000 said it would or has it changed? If it does, DIP1000 was then only "partially" accepted??

I also saw somewhere that pointers should not be used in D anymore in most cases because `ref` is a better and safer alternative... is that a correct assessment? If we want to write code that benefits from the goals of DIP1000, do we currently need to know the exact meaning of `return ref scope` VS `ref return scope` and the many other variants with `const`, `auto` and others? This seems really error prone and difficult to understand, no? This kind of makes Rust look simple.
August 16
On 16/08/2024 5:59 AM, Renato Athaydes wrote:
> On Thursday, 15 August 2024 at 15:20:59 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> On 16/08/2024 3:18 AM, Jonathan M Davis wrote:
>>> On Thursday, August 15, 2024 8:56:29 AM MDT Richard (Rikki) Andrew Cattermole
>>> via Digitalmars-d wrote:
>>>> On 16/08/2024 2:47 AM, Jonathan M Davis wrote:
>>>>> Either way, the person to convince would be Walter, and based on past
>>>>> discussions of this sort, I doubt that he'll be convinced, but who knows.
>>>>> It can sometimes be quite surprising what he does or doesn't agree with,
>>>>> and it's not like he never changes his mind.
>>>>
>>>> Considering that he allowed the abomination that is return and scope
>>>> ordering to result in two different attributes, it's worth talking with
>>>> him about it I'd say!
>>>
>>> That is indeed an abomination, and I'd love to see that fixed (though
>>> honestly, I'd love to see DIP 1000 thrown out entirely), but it's a very
>>> different situation from const ref vs ref const. The problem with
>>> return scope vs scope return is that it not only makes the order matter, but
>>> it makes it so that each order means different things. On the other hand,
>>> requiring ref const would be requiring a fixed order when we have no need to
>>> do so, and both orders are currently fine.
>>>
>>> - Jonathan M Davis
>>
>> I'm currently writing up a proposal to replace DIP1000 in its entirety and yeah I got great joy from writing the grammar removal for it 2 hours ago!
> 
> I am trying to understand what is currently happening with D, and where it is going. It's extremely confusing. I see DIP1000 mentioned a lot, and was under the impression it had already been "accepted"? But now I see it is marked as "superseded"?? By what?

The implementation.

> Someone briskly told me to stop using `in` because that's "buggy" or something, and I found [a comment from 2018](https://forum.dlang.org/thread/dkstvxwbcluncgllvypt@forum.dlang.org) (wow, 6 years ago?!) explaining that there's controversy on what that should actually mean (`const` VS `const scope`) and the current docs mention it's just `const` unless you use the `-preview=in` flag (so I guess it did end up meaning `const scope` but it's still hidden behind a flag, perhaps temporarily??)... and does `scope` do what DIP1000 said it would or has it changed? If it does, DIP1000 was then only "partially" accepted??

DIP1000 was accepted, but was never fully turned on. It is now back under a preview switch.

In practice we have learned that it wasn't a good design. It has been very heavily misunderstood and very few people have any understanding of it.

In the next week or so, we are going to be having a meeting to discuss replacing it.

> I also saw somewhere that pointers should not be used in D anymore in most cases because `ref` is a better and safer alternative... is that a correct assessment?

If you need a pointer, use a pointer.

However you should use ``ref`` and ``out`` on function parameters instead of requiring an extra taking a pointer to something before passing.

But if you go on to use a pointer, just use the pointer.

> If we want to write code that benefits from the goals of DIP1000, do we currently need to know the exact meaning of `return ref scope` VS `ref return scope` and the many other variants with `const`, `auto` and others? This seems really error prone and difficult to understand, no? This kind of makes Rust look simple.

Correct. Hence why as a design it has failed.

There is also a lack of distinction for outputs that aren't just the first parameter.
August 15
On Thursday, 15 August 2024 at 15:20:59 UTC, Richard (Rikki) Andrew Cattermole wrote:
> I'm currently writing up a proposal to replace DIP1000 in its entirety and yeah I got great joy from writing the grammar removal for it 2 hours ago!

I have to say I get a little bit anxious with people saying it needs to be removed or replaced.

Not pretending it is sane to use - although I have grown accustomed to it - but the fact you can safely take refs to things is amazing. Both from a performance perspective as well as being able to implemente things like non-copyable types (which you then safely share via ref).

Would be a real shame to see that go. Which won't stop me of course, except it won't be @safe anymore. :(
August 16
On 16/08/2024 7:12 AM, Sebastiaan Koppe wrote:
> On Thursday, 15 August 2024 at 15:20:59 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> I'm currently writing up a proposal to replace DIP1000 in its entirety and yeah I got great joy from writing the grammar removal for it 2 hours ago!
> 
> I have to say I get a little bit anxious with people saying it needs to be removed or replaced.
> 
> Not pretending it is sane to use - although I have grown accustomed to it - but the fact you can safely take refs to things is amazing. Both from a performance perspective as well as being able to implemente things like non-copyable types (which you then safely share via ref).
> 
> Would be a real shame to see that go. Which won't stop me of course, except it won't be @safe anymore. :(

Yeah I get it, I have significantly more than 120k LOC of it.

I am not looking forward to having to change all that code.

But at the same time, DIP1000 isn't meeting our needs so it's time to go back to the drawing board if we want D to be safe and my current design I think looks pretty good.

August 16
On Thursday, 15 August 2024 at 19:12:03 UTC, Sebastiaan Koppe wrote:

>
> Would be a real shame to see that go. Which won't stop me of course, except it won't be @safe anymore. :(

I'm not aware of any concrete plan to get rid of it. Issues with it frequently come up as tangents in our monthly meetings, so we're having a meeting next week to focus explicitly on those and discuss what needs to be done about them.
August 16
On Friday, 16 August 2024 at 02:46:16 UTC, Mike Parker wrote:
> I'm not aware of any concrete plan to get rid of it. Issues with it frequently come up as tangents in our monthly meetings, so we're having a meeting next week to focus explicitly on those and discuss what needs to be done about them.

I hope you’ll share a summary with us afterwards!
August 16
On Friday, 16 August 2024 at 13:43:15 UTC, IchorDev wrote:
> On Friday, 16 August 2024 at 02:46:16 UTC, Mike Parker wrote:

>
> I hope you’ll share a summary with us afterwards!

I'll do a blast of every planning session we've had for the past few months at the end of this month. I don't do full summaries of those, just the big decisions.
August 16

On Thursday, 15 August 2024 at 17:59:59 UTC, Renato Athaydes wrote:

>

I am trying to understand what is currently happening with D, and where it is going.

That’s a complicated question. If you want a good answer, ask Walter and Átila, since it’s ultimately up to them what does or does not get added to the language.

>

Someone briskly told me to stop using in because that's "buggy" or something

No, it’s just in a state of uncertainty:

  • In the canonical language right now it’s a way of making parameters const, but since it has to be written like a storage class it means you can’t write even the equivalent of (for example) const(void)*, so it’s completely redundant. It could be removed and no functionality would be taken away.
  • With the preview switch it’s scope ref const that binds rvalues, which is useful when you want to take medium-sized structs by reference to reduce copying (rather than to mutate them). Since it’s behind a preview switch it’s not part of the canonical language, and may or may not ever become part of the canonical language at this point.
  • A future proposal could replace both of these versions of in without much warning since they are rarely used.
>

and I found a comment from 2018 (wow, 6 years ago?!) explaining that there's controversy on what that should actually mean (const VS const scope) and the current docs mention it's just const unless you use the -preview=in flag

Yeah the fact that it’s remained a preview for so long isn’t promising. It’s like a feature graveyard.

>

and does scope do what DIP1000 said it would or has it changed? If it does, DIP1000 was then only "partially" accepted??

Only if you use -preview=dip1000, otherwise scope is more of a promise than a compiler-enforced guarantee. A lot of us wanted DIP1000 to work out, but it hasn’t for a variety of reasons.

>

I also saw somewhere that pointers should not be used in D anymore in most cases because ref is a better and safer alternative... is that a correct assessment?

Not really. Use whichever you prefer. Pointers will never bind to rvalues, whereas there’s a preview for ref binding to rvalues already. Pointers to structs require explicit &/*, ref lets you write the same code as for passing by value.

1 2
Next ›   Last »