3 days ago
On Tuesday, 28 October 2025 at 23:30:36 UTC, Paul Backus wrote:
> On Tuesday, 28 October 2025 at 20:59:06 UTC, Peter C wrote:
>> When a programming language actively and intentionally prevents me from being explicit about how the members of my class can be accessed, the programming language becomes irrelevant to me.
>
> Does that mean you're going to stop posting about it?

We should set up a forum called D Apostates, there could be an "Introduce Yourself" thread where you say why you stopped using D and what language you're switching to.
3 days ago
On Wednesday, 29 October 2025 at 16:20:35 UTC, Abdulhaq wrote:
> On Tuesday, 28 October 2025 at 23:30:36 UTC, Paul Backus wrote:
>> On Tuesday, 28 October 2025 at 20:59:06 UTC, Peter C wrote:
>>> When a programming language actively and intentionally prevents me from being explicit about how the members of my class can be accessed, the programming language becomes irrelevant to me.
>>
>> Does that mean you're going to stop posting about it?
>
> We should set up a forum called D Apostates, there could be an "Introduce Yourself" thread where you say why you stopped using D and what language you're switching to.

Significant cases are well known
3 days ago

On Wednesday, 29 October 2025 at 13:55:42 UTC, jmh530 wrote:

>

On Tuesday, 28 October 2025 at 22:36:58 UTC, Lance Bachmeier wrote:

>

[...]

I should preface this by repeating again that I really don't care about whether to make this change...

[...]

the thing is, it doesnt actually solve anything. if you have access to the module, you can simply change the class to gain access. you can simply cast the class to something. so all it really does it prevent accidential use.
and you can have the same thing by just naming your variables accordingly.

the whole thing only makes sense when you have a closed 'module' someone else accesses without the ability to edit it. and we have that.

also every language addition (even minor ones) make the language very complex and harder to maintain and understand.

3 days ago

On Wednesday, 29 October 2025 at 16:18:22 UTC, Paul Backus wrote:

>

On Wednesday, 29 October 2025 at 13:55:42 UTC, jmh530 wrote:

>

You say it's a "major change to the language". Is it really? I thought private(this) was added to Open D without much difficulty.

It's a change to the grammar, which means that all parser-based tooling (DCD, DScanner, serve-d, etc.) would need to be updated to support it.

Hmm, I don't have a sense of how much of a lift that is. But I think it comes back to putting the burden on the people who support the DIP. Make a list of tools that need to be updated and say the DIP is only approved if they update those to support it.

> >

It's also occasionally more difficult to split up code into multiple modules. For instance, what if you are prototyping something in run.dlang.io (impossible I think in this case)

You can actually have multiple modules on run.dlang.io, using the following syntax:

--- lib.d
module lib;

int fun() { return 42; }

--- app.d
module app;

import lib;

void main()
{
    assert(fun() == 42);
}

Sorry, I think I knew this but had forgotten.

(Jonathan Marler who wrote the HAR code left the D community for Zig, might be something that the DLF could take over)

> >

With respect to the secondary arguments:

  1. On the mental complexity budget issue, I don't view that as a big issue as it is a convenient extension of the protection modifiers. protected and package are probably more confusing than this.

Managing overall language complexity is the #1 challenge in language design. If you don't take this seriously, your language ends up like C++ or Perl--a huge mess that nobody really understands completely. (You could argue that D has already crossed this line, but even if that's true, it doesn't mean we should make it worse.)

Even features that are small and simple in isolation can add up to an enormous amount of complexity if you accumulate too many of them (see: Perl). So the fact that this individual feature is relatively simple is not a strong counterargument.

The optimal amount of complexity isn't zero. Obviously.

As with all things, there is a trade-off, whether that's against performance, expressiveness, etc. If all you care about is complexity, then you would never add any new features. It's an argument for setting things in stone (and I thought the whole point of editions was to allow the language to evolve).

The argument about complexity is most convincing when it is phrased like "this feature adds complexity without generating enough of an improvement in performance/expressiveness/etc" (or from a second-level basis something like if we add this feature now then it may place a higher burden on adding additional features).

In this sense, it is a question of marginal cost (complexity) vs. marginal benefit (performance/expressiveness/etc).

On the marginal cost side, there are lots of different kinds of complexity. What you responded to was me talking about cognitive complexity. I happen to think that's really small here. But people can disagree. The complexity I would be more worried about is the impact on the compiler code base. I don't have the ability to speak to that, but I take people like Dennis and Walter at their word that it's something to be concerned about. But if the argument against it is that complexity will increase, then the argument carries more weight if we can spell out more concretely how it will increase.

On the marginal benefit side, there are clearly people out there pounding the table for this feature, even if it's not that important to most.

My point is that I don't think it's a slam dunk in favor of adding this feature, or for that matter saying no. I think it's something that should get weighed.

This complexity vs. expressiveness trade-off shows up in a number of places in D. The string interpolation debate was one example where a less complex solution was proposed and was loudly shouted down in favor of a more complex and more expressive solution (and led to the creation of openD). When DIP1000 was originally discussed, the approach was argued for as less complex than a more generally expressive approach. And we're still debating these issues now, like 9 years later. Sometimes the more expressive approach will be less demanding from a cognitive perspective, even if it is more complex to implement.

At the top I said the optimal amount of complexity isn't zero. Even something like the trade off between complexity and performance/expressiveness/etc., we would be trying to evaluate the language on a more-or-less objective basis. Another way to think about it is whether adding a feature will mean more projects get written in D than otherwise (or even better consider something similar that incorporates profits or some measure of value-add) (note: I don't mean actual people writing actual projects per se, so much as hypothetical people writing hypothetical projects). This could also account for second order effects where if the feature makes D harder to implement other new features or have higher cognitive load, then it would impact the trajectory. This framework would suggest that if has a first order impact of getting more people to write more D projects (esp. if they are projects with positive value-add) with limited second order impact, then it should be given a reasonable considered, especially with Editions being added to the language.

The D leadership has built a really cool programming language, but it's still a niche programming language. And I don't see much on the horizon to change that. If they want it to stay a niche language, then that's fine. If they want to make it a more popular language, then they might need to change the way they think about some of these issues.

3 days ago

On Wednesday, 29 October 2025 at 19:59:15 UTC, jmh530 wrote:

>

The D leadership has built a really cool programming language, but it's still a niche programming language. And I don't see much on the horizon to change that. If they want it to stay a niche language, then that's fine. If they want to make it a more popular language, then they might need to change the way they think about some of these issues.

Thanks.
This is well thought analysis.

I think the question of personality (author of proposal) is also important.

Proposals from well-known:

  • compiler/phobos contributors
  • library creators
  • ecosystem maintainers (thanks for maintaining Mir btw)

have different "weight" than from "first time forum poster 3 days ago" or from forkit/claptrap.

That's why the comparison of the situation with i-strings when it was a discussion between Paul, Adam, Steven, Timon and Walter has nothing to do with messages that popping up every year from the same one single person.
So the pushback in the current situation is understandable.

But do you personally @jmh530 think that this is the main issue that core developers need to spend their time (even for analysis and consideration)?

I don't think that adding class-private will change anything in D popularity and ability to bring attention from wider range of developers.
And D has more important things to fix first.

3 days ago
On Wed, Oct 29, 2025 at 09:01:03PM +0000, Sergey via Digitalmars-d wrote: [...]
> I don't think that adding class-private will change anything in D popularity and ability to bring attention from wider range of developers.  And D has more important things to fix first.

Exactly.


T

-- 
Once the bikeshed is up for painting, the rainbow won't suffice. -- Andrei Alexandrescu
3 days ago
On Wednesday, 29 October 2025 at 16:18:22 UTC, Paul Backus wrote:
>
> ..
> Managing overall language complexity is the #1 challenge in language design. If you don't take this seriously, your language ends up like C++ or Perl--a huge mess that nobody really understands completely. (You could argue that D has already crossed this line, but even if that's true, it doesn't mean we should make it worse.)
>
> Even features that are small and simple in isolation can add up to an enormous amount of complexity if you accumulate too many of them (see: Perl). So the fact that this individual feature is relatively simple is not a strong counterargument.

There is nothing complex about scopeprivate. That's yet another strawman arguement.

scopeprivate fits absolutely perfectly with D's principle: "make things open by default, restrict them only when you mean to."

it also fits absolutey perfectly with the principle that: "Collaboration does not disolve ownership" - which already applies with to private, package and public - with the unfortunate scenario that it suddenly no longer applys anymore when more than one type is within a module, or a type and a helper method, or a type and a unittest.

scopeprivate restores a consistency mental model.

It's also about balancing the safe use of a type, with practical collaboration. It's a little bewildering to my why that would be so controversial.

And really, if scopeprivate produces cognitive overload in a programmers brain, they probably should choose another profession.

3 days ago
On Wednesday, 29 October 2025 at 01:18:42 UTC, Lance Bachmeier wrote:
>
> The problem with your approach is that you're proposing a major change to the language....

Actually, that really is not what I'm doing.

What I am trying to do, is establish a set of principles that people can agree on.

That what is difficult.

Getting it the language is pretty simple, if the principles are sound, and people agree that they are sound.

See me previous post just know as to what those 2 principles are.

Those 2 principles already exist in D.

All I'm asking, is why does D need to discard those 2 principles for code inside a module?

I prefer a consistent mental model based on principles that don't get discarded - just for convenience.
2 days ago

On Wednesday, 29 October 2025 at 01:32:38 UTC, Peter C wrote:

>

Nobody has ever demonstrated why it should - most likely, because it's not a valid principle.

Current design is valid, because it works.

2 days ago

On Wednesday, 29 October 2025 at 21:01:03 UTC, Sergey wrote:

>

[snip]
have different "weight" than from "first time forum poster 3 days ago" or from forkit/claptrap.

That's why the comparison of the situation with i-strings when it was a discussion between Paul, Adam, Steven, Timon and Walter has nothing to do with messages that popping up every year from the same one single person.
So the pushback in the current situation is understandable.

Are they the same person? I can't keep track. People should just stick with one ID. If it's just one person making a big deal about this, then it would change the calculus.

>

But do you personally @jmh530 think that this is the main issue that core developers need to spend their time (even for analysis and consideration)?

I've been pretty clear on this thread that it's not something that's important to me and that all actual work on something like this should be pushed to the people who are advocating for it. Even in an ideal situation, core developers would still have to spend some time for evaluating the DIP.

>

I don't think that adding class-private will change anything in D popularity and ability to bring attention from wider range of developers.
And D has more important things to fix first.

My point wasn't about class-private specifically. It was about more about a framework for thinking about changes to the language. Standing athwart history yelling stop isn't a good strategy for getting wider adoption.

I wouldn't be the first person to say that when the D leadership team takes stances that push away effective contributors, then that has a big impact on the ecosystem.