Why is D unpopular, redux.

deadalnix deadalnix at gmail.com
Sun May 22 00:14:33 UTC 2022


On Saturday, 21 May 2022 at 19:46:48 UTC, Walter Bright wrote:
> On 5/21/2022 4:54 AM, deadalnix wrote:
>> There are holes in the foundations of the languages. These 
>> hole prevent basic things from being possible at all. For 
>> instance, containers.
>
>
> Ok, can you please provide a comprehensive list of these holes?

I've done so a gazilion time, and the fact you cannot think of 
one is the focus problem I'm talking about. Just on type 
qualifiers:
  - Transitivity of type qualifier doesn't play nice with 
template. There is no way to tell the compiler that a `const 
Tpl!T` actually is a `const Tpl!(const T)`. As a result, no 
container library is possible and ranges have serious problem 
when it come to qualifiers too.
  - delegates break constness guarantees as the type qualifier ont 
he context is not tracked and/or checked.
  - closure break constness guarantee, as I can mutate an 
immutable variable visible in a closure when iterating in a loop.
  - There is no way to build a shared object without breaking the 
type system.
  - shared is supposed to be explicit, yet all objects have a 
monitor - granted this one is not broken per se, but a major WTF.
  - synchronized shared object cannot provide the guarantee they 
are supposed to because there is no adequate escape analysis.
  - const/immutable doesn't play nice with reference types (the 
qualify both the object and the reference), making the type 
qualifier system pretty much unworkable with OOP style code.

It's just on top of my head, but I'm sure there is more.

Now, don't get me wrong, some of these are hard problems. But the 
more we add to the pile of stuff we have, the harder they become 
to solve.


More information about the Digitalmars-d mailing list