Why is D unpopular, redux.

deadalnix deadalnix at gmail.com
Wed May 25 00:08:57 UTC 2022


On Tuesday, 24 May 2022 at 23:31:58 UTC, Walter Bright wrote:
> If the fix did not fix other cases, then they are separate 
> bugs. They certainly may be related, but if they require more 
> code, they are separate.
>
> Our whole use of github and bugzilla revolves around a 1:1 
> correspondence between bug fixes and PRs. A 1:many and many:1 
> is just not manageable.

But they are not, and this is why this doesn't get resolve. These 
aren't bugs, there is a design issue.

You have essentially two way to go at it:
1/ Allocate a closure int he loop. This remains unsound by itself 
because the qualifier of the closure is not tracked, which lead 
to possible implicit sharing for instance and other nastyness. 
There is not enough information in the typesystem to solve this, 
so going at it bug by bug will simply be an exercise in wack a 
mole.
2/ Prevent capture of object beyond their lifetime. This require 
ownership and lifetime tracking. DIP1000 doesn't have the depth 
required to do so adequately - it lacks the recursiveness 
required to track indirections - so once again, fixing bugs one 
by one is an exercice in wack-a-mole.

Because the design is inadequate to begin with, you can only fix 
presumably more common holes (because they got reported first) by 
creating more uncommon ones at best, make no progress at worse.

To fix these problems, you actually need to think of the system 
it term of the invariant that each part either require or imply, 
and find where these do not match.

these problem with closure are quite complex, but there is an 
exemple of this that is much simpler and easy to grok: final 
switch vs non promoting binary operation on enums.

One assumes the invariant that enum are bounded to the set of 
values declared in the enum, but the second doesn't effectively 
relegating the enums to be a subtype of their base class. They 
just cannot be both within a sound system.

There is no amount of getting test cases to pass that will fix 
this problem with enums, because it is a design problems. Almost 
all soundness problems are, BTW.


More information about the Digitalmars-d mailing list