D has become unbearable and it needs to stop

FeepingCreature feepingcreature at gmail.com
Wed Jul 5 10:14:38 UTC 2023


On Wednesday, 5 July 2023 at 09:50:55 UTC, harakim wrote:
> This article has stuck with me over the years: 
> https://arstechnica.com/gadgets/2022/10/windows-95-went-the-extra-mile-to-ensure-compatibility-of-simcity-other-games/
>
> That is what made Windows successful. It was what made .NET and 
> Java successful. You can write a program and then you have a 
> program.
>

Linux guarantees binary compatibility. ("We do not break 
userspace!") However, Linux is IMO more willing than D to say 
"well, that API was a mistake, we're going to support it but 
we'll also offer a new API that does it right." Microsoft, of 
course, does the same thing. And ultimately, that's dependent on 
your ability to engineer a clean separation between the user API 
and the internals. D is hampered here because a user type has a 
*lot* of ways to be sensitive to implementation internals, and 
they can stack exponentially.

Maybe at some point D has to start deprecating *combinations* of 
features; to say "well, we're adding a new functionality, if you 
want to use that you cannot use this old functionality." So all 
the code that was written at time X continues to work, but the 
*features* that were available at time X don't necessarily work 
together with features that were available at time X+1. We have 
to get the combinatorial explosion under control somehow.

> If someone at my work removed a field that I was using from a 
> database or an optional field from an API, I would flip out. I 
> have never seen removing "useless" or "ambiguous" features as a 
> good thing if people are actually using them. If that's the 
> case, then you have to go out and talk to them and get them to 
> agree first because you're the one who screwed up. Otherwise, 
> you leave it as it is.
>

And what do you do when that person has left the company and you 
don't have anyone with commit access to their code? If I push for 
a Phobos deprecation, I'd love to be able to go through all 
affected projects and update their code; the problem is first 
that I can't *find* all affected projects because they'll be 
either closed-source or not in Buildkite, and second if I do find 
them that there's no guarantee there's anybody there to actually 
look at the fix. How many months should I wait for PRs?

Theoretically the use of the 'deprecated' feature is exactly to 
draw user attention to n upcoming change, and D already has very 
wide deprecation windows. If something is marked as deprecated 
and people only speak up (and post their repos) once it's 
actually removed, my sympathy is honestly limited.

> I see this has been brought up, but why not use compiler flags? 
> It's a win for everyone. You do have some extra code in the 
> compiler until the next major version, but refer back to my Sim 
> City example. That's the price of being a stable tool.

Compiler flags don't work as soon as libraries come into play. 
Really, what you'd want is *package flags;* settings that 
lexically affect exactly the modules of a particular dub library.


More information about the Digitalmars-d mailing list