June 15, 2023
On 15/06/2023 2:44 PM, Chris Katko wrote:
> imported std.regex? You just doubled your compile time. There's a gotcha.

That is more or less solved.

https://github.com/dlang/phobos/pull/8699
June 15, 2023
On 6/8/2023 10:20 AM, Johan wrote:
> - Intentional change of behaviour, sometimes without clear solution path or with buggy solutions. https://issues.dlang.org/show_bug.cgi?id=23966 and 23977 for recent examples.

I suggest:

Restore the old getAttributes behavior, and create a new getAttributes2 with the new behavior.

Will that work for you?
June 15, 2023

On Thursday, 15 June 2023 at 07:07:18 UTC, Walter Bright wrote:

>

On 6/8/2023 10:20 AM, Johan wrote:

>

I suggest:

Restore the old getAttributes behavior, and create a new getAttributes2 with the new behavior.

Will that work for you?

Going a bit offtopic, but this is one case where a true package system would come in handy! You could opt into migrations on a per-package basis, and have one compilation that mixes for instance different usages of getAttributes in different source files with no ambiguity or confusion.

One may even imagine bundling lots of migrations into "language editions" and updating those on a "long-term" basis.

dub.json:

    "edition": "d-2023",

(More at my dconf talk!)

June 15, 2023
On 6/9/2023 2:22 AM, GrimMaple wrote:
> The better way has been proposed already, it's just being dismissed without consideration. What is your take, what will allow us to have an LTS branch?

It's come up before many times, it's not like we haven't considered it.

We actually do have it - we do major releases, and point releases. Into the point releases go regression fixes and critical bug fixes.

The trouble, though, is we simply don't have the staff to do a whole lot with this.
June 15, 2023

On Friday, 9 June 2023 at 08:05:18 UTC, Walter Bright wrote:

>

On 6/8/2023 7:56 AM, GrimMaple wrote:

>

The truth is, I've been nagging about LTS branches, and I've been nagging directly to Mike about it, and it went nowhere.

It's not about not caring about it. It's just that I can't see how it would be effective. Making LTS versions balkanizes the language into multiple languages, which will play hell with 3rd party library maintenance.

Clearly, the deprecation scheme is not serving our users well. We'll have to find a better way.

On Thursday, 15 June 2023 at 07:39:02 UTC, Walter Bright wrote:

>

It's come up before many times, it's not like we haven't considered it.

We actually do have it - we do major releases, and point releases.
Into the point releases go regression fixes and critical bug fixes.

The trouble, though, is we simply don't have the staff to do a whole
lot with this.

I understand this could be division (or maybe also to say repetition) to the core/language developers if we introduce LTS in D. I mean, if there was a security vulnerability that was fixed, it would need to be replicated on the active LTS releases, etc.

However, I do not see why this would cause a division for 3rd Party Libraries - as they should be targeting their releases towards LTS, anyway.

I think enough content has been voiced about LTS and, generally, appear to be on a similar wavelength by those in favour of it. Certainly enough for it to be discussed in a near future meeting with the core members.

I understand there might not be enough staff at this time and other factors. I get it. I still believe this can spark more discussion and, potentally, form a strategy on how it could work if we had X, Y and Z.

If a plan is presented and is understood on what needs to be done + the work involved, maybe someone will step up and get involved.

Thanks.

June 15, 2023
On Thursday, 15 June 2023 at 04:18:34 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 15/06/2023 2:44 PM, Chris Katko wrote:
>> imported std.regex? You just doubled your compile time. There's a gotcha.
>
> That is more or less solved.
>
> https://github.com/dlang/phobos/pull/8699

That's great news!
June 15, 2023
On Thursday, 15 June 2023 at 07:07:18 UTC, Walter Bright wrote:
> Restore the old getAttributes behavior, and create a new getAttributes2 with the new behavior.
>
> Will that work for you?

This is often even worse than just changing the original, so such things need to be evaluated on a case-by-case basis.

For the case of getAttributes, there's nothing actually wrong with the original behavior! The proposed getAttributes2 would be exactly identical to getAttributes, except that it gives a deprecation message on certain (currently ambigously defined, but could easily become defined) uses. There's no benefit to this and it would just add to long-term confusion as new people wonder what the differences are between the two.

(Something similar happened with getVirtualMethods and getVirtualFunctions. One was simply defined incorrectly and instead of fixing it, the other was introduced with a subtly different definition. That one is more justifiable than getAttributes2 would be, since it actually *was* defined, and *maybe* that subtle difference matters, and it is hard for the compiler to statically detect. But now the current result is you have a function that is wrong and a function that is right sitting side by side with only a careful reading of the docs revealing which is which.)

What I would suggest for getAttributes is either:

Option 1: Define its status quo behavior on the spec. If passed an overloaded function symbol, it will return the attributes of the lexically first function in the set. There's nothing actually wrong with that if people know what to expect and how to work with it! Put in the docs: Tip: you can use getOverloads to loop over all the overloads in the set. Optionally, change getOverloads so it also works on non-functions, so you can always loop over names and overloads (Even if a set of one item in the case of non-overloadable entities) without a separate branch.

OR

Option 2 (my preference): Sit down and define what, exactly, an overload set is in the language and make it into its own conceptual model with associated definitions in the reflection system. I don't have a specific proposal for D right now, but in my little script.d language, I made overload sets actually be an object with opCall defined. This is, of course, different since script.d is a dynamic language so many things, including overload resolution, happen at runtime. Indeed, this design was less about conceptual purity than about laziness in implementation - I already had objects and opCall working, so defining an object that internally had an array of functions and dispatched it was fairly easy.

But a side effect is the rest of the language can still work with it. I can loop over the overloads by... just literally looping over the overload set member in the object. You can detect it is an overload set by comparing object types. Other properties can be attached to it, etc.

That exact implementation is not right for D, but perhaps something similar could work. We could define all kinds of things in both the docs and in the language, iron out some edge cases, and make reflection easier to use.


You might even do both of these options, #1 in the short term, and #2 as part of a complete overhaul of the reflection system. Our random collection of of traits has served D well so far, but a second draft can learn a lot from its real world lessons and then both would exist side by side as a compatibility bridge.
June 15, 2023
On Thursday, 15 June 2023 at 02:44:59 UTC, Chris Katko wrote:
> Tell any other object about yourself in the constructor? segfault. Because your object isn't constructed till _after_ the constructor runs. There's a gotcha.

What case triggers this? I've heard of most the other things but this one I can guess a couple things on but I'm not sure.

> Not adding a feature I can use like [private] for classses (if I understand correctly, they don't do anything in D)

The `private` keyword always applies on the module level, so a private class member can be seen inside its module but not outside it.
June 15, 2023

On Thursday, 15 June 2023 at 12:35:37 UTC, Adam D Ruppe wrote:

>

Option 1: Define its status quo behavior on the spec. If passed an overloaded function symbol, it will return the attributes of the lexically first function in the set. There's nothing actually wrong with that if people know what to expect and how to work with it!

Yeah, hard disagree; or rather: "there's nothing actually wrong if people know what to expect and how to work with it" ... and do so reliably, which is to say that it is terrible. If you place a pit of despair next to a feature, you should not blame the user for falling into it. The truth is, getAttributes invites handling overloads wrong, it's a footgun, because you'll probably not be testing it with overloads and unless you choose the right tests, even if you do it will still appear to work correctly, while silently executing a behavior that you probably won't expect and definitely won't notice until a user complains years later when you have long moved on to another project.

June 15, 2023

On Tuesday, 13 June 2023 at 16:57:15 UTC, GrimMaple wrote:

>

Yes, that is the whole point of this thread. To ask for some sort of stability in the D ecosystem. Because, practically, there isn't just "the latest version", there are 10 to 20 versions of D in the wild at the same time, and it's impossible to deal with.

Hi,
I hope you don't mind my opinion since it's my first post here. But in my defense I'm a lurker for years. For some reason I like this forum very much.

While I didn't read every answer in this particular thread, I thought the quote from OP can be very well summarised to:

"I need some sort of stability despite the numerous versions of D."

Thinking about this, I'm not sure a LTS support version is the best solution for this problem, because the primary thing you need is stability not support. What you need is the possibility to have a stable working environment when dealing with older versions. That your software is building even when new versions of a D compiler or some libraries are released. I think the solution to this lies in a package manager that allows for different versions of D including the associated libraries.