May 22, 2022

On Friday, 20 May 2022 at 12:59:04 UTC, rikki cattermole wrote:

>

Why can't I support const? To iterate, you need to be able to mutate state. This includes an iterator (for concurrent iteration + mutation support). And of course reference counting.

I just want to note that librebindable was created to solve this exact problem. I'm gonna do a dconf talk on that, too. (Yay!)

https://code.dlang.org/packages/rebindable We've mostly done development on the code in an inhouse repo, so this is a bit outdated, but nothing in the internals has changed, as far as I can remember. I'm going to do an update of the public repo before DConf, add some utility types as examples and so on. But the core idea has been surprisingly stable.

May 22, 2022

On Sunday, 22 May 2022 at 13:46:29 UTC, FeepingCreature wrote:

>

On Friday, 20 May 2022 at 12:59:04 UTC, rikki cattermole wrote:

>

Why can't I support const? To iterate, you need to be able to mutate state. This includes an iterator (for concurrent iteration + mutation support). And of course reference counting.

I just want to note that librebindable was created to solve this exact problem. I'm gonna do a dconf talk on that, too. (Yay!)

https://code.dlang.org/packages/rebindable We've mostly done development on the code in an inhouse repo, so this is a bit outdated, but nothing in the internals has changed, as far as I can remember. I'm going to do an update of the public repo before DConf, add some utility types as examples and so on. But the core idea has been surprisingly stable.

I wonder if it would be easier to use __traits(getPointerBitmap) instead of recursion on T.tupleof to determine the layout of Rebindable!T?

May 23, 2022

On Sunday, 22 May 2022 at 10:18:11 UTC, Max Samukha wrote:

>

Manu.

Manu has another ... proposal, which is very easy to use.
And it is orthogonal to the vector.

May 22, 2022
On 5/22/2022 6:34 AM, deadalnix wrote:
> I would say it is not a breaking change. I write contracts so that I know when my code is broken. When the compiler fails to do so, then it is a bug in the compiler. If my code breaks because this is fixed, then that means that my code **always was broken to begin with**. I'd rather know about it.

Fair enough, but I've fixed many broken features to find that people depended on them, and then complained that D is unstable.
May 23, 2022

On Monday, 23 May 2022 at 03:13:29 UTC, Walter Bright wrote:

>

On 5/22/2022 6:34 AM, deadalnix wrote:

>

I would say it is not a breaking change. I write contracts so that I know when my code is broken. When the compiler fails to do so, then it is a bug in the compiler. If my code breaks because this is fixed, then that means that my code always was broken to begin with. I'd rather know about it.

Fair enough, but I've fixed many broken features to find that people depended on them, and then complained that D is unstable.

Does that mean we need to complain more loudly that D is broken? ;-)

IMO, fear of breaking things is for projects who think they already have the most users that they will ever have. If you anticipate more people using D in the future, you should not let the complaints of current users cause pain for future users.

At any rate, my personal oft-stated opinion is of course that the rate of change is too small. (Though I can't complain too loudly, since I've not exactly been making a lot of pull requests lately...)

May 23, 2022
On Mon, May 23, 2022 at 01:46:25PM +0000, FeepingCreature via Digitalmars-d wrote: [...]
> IMO, fear of breaking things is for projects who think they already have the most users that they will ever have. If you anticipate more people using D in the future, you should not let the complaints of current users cause pain for future users.
> 
> At any rate, my personal oft-stated opinion is of course that the rate of change is too small. (Though I can't complain too loudly, since I've not exactly been making a lot of pull requests lately...)

Breaking changes is actually a good thing, *provided* users are given an off-ramp to smoothly migrate to the new way of writing things. (And also, the mere existence of an off-ramp is not the same thing as an off-ramp that's obvious to the user or told to him when the breakage happens -- e.g., if the compiler proposes the new way of writing it.)

I've told before of the deprecation of pointers implicitly converting to bool, that actually improved my code:

	// Before:
	T* ptr;
	if ((ptr = func()) && ...) { ... }

	// After:
	T* ptr;
	if ((ptr = func()) !is null && ...) { ... } // look, ma! More readable!

This kind of breaking change is welcome.

But breakages that have no workarounds are rather unwelcome.


T

-- 
In theory, software is implemented according to the design that has been carefully worked out beforehand. In practice, design documents are written after the fact to describe the sorry mess that has gone on before.
May 23, 2022

On Monday, 23 May 2022 at 13:46:25 UTC, FeepingCreature wrote:

>

IMO, fear of breaking things is for projects who think they already have the most users that they will ever have. If you anticipate more people using D in the future, you should not let the complaints of current users cause pain for future users.

I don't think so, I don't want things to break cause I want my code to keep working. It's been brought up millions of times but D has terrible project management, and it probably never will change as the current project maintainers are happy with the way things are.

I don't know what to say when you have so many broken features that it becomes a regular occurrence that people become dependent on your broken features. Obviously something isn't working.

May 23, 2022
On Monday, 23 May 2022 at 17:30:38 UTC, mee6 wrote:
> I don't think so, I don't want things to break cause I want my code to keep working.

Not all breakages are the same.

Some of the "breakage" I want are places where the compiler accepts invalid things according to the spec. Which means your code is *currently* broken, just the compiler doesn't tell you.

You also need to consider migration paths and if it is forward or backward compatible.
May 23, 2022

On Monday, 23 May 2022 at 17:30:38 UTC, mee6 wrote:

>

On Monday, 23 May 2022 at 13:46:25 UTC, FeepingCreature wrote:

>

IMO, fear of breaking things is for projects who think they already have the most users that they will ever have. If you anticipate more people using D in the future, you should not let the complaints of current users cause pain for future users.

I don't think so, I don't want things to break cause I want my code to keep working. It's been brought up millions of times but D has terrible project management, and it probably never will change as the current project maintainers are happy with the way things are.

Right, but most of all I want my future code to be better!

Is there more future D code or more present D code? Which is more important? That's the relevant question, I think.

May 23, 2022

On Monday, 23 May 2022 at 17:59:11 UTC, FeepingCreature wrote:

>

Right, but most of all I want my future code to be better!

Easy to solve, use 4 branches: old, stable, nextgen, experimental. Every 3 years advance stable to old, nextgen to stable. Features move from experimental to nextgen when completed and tested. Old gets critical security updates, but not much more. Stable gets fixes.

Then everyone has 3+ years to upgrade their codebase. If they want faster use nextgen or experimental.

And use semver.

No more confusion... and more freedom.