What's wrong with D ? this bug remains unfixed since 12 years

Basile B. b2.temp at gmx.com
Thu May 30 22:20:54 UTC 2024


On Thursday, 30 May 2024 at 18:09:34 UTC, Paul Backus wrote:
> On Thursday, 30 May 2024 at 13:10:54 UTC, Basile B. wrote:
>> I have a theory that is "we all make the same mistakes" (i.e 
>> when it's time to implement, we the human beings). It's 
>> possible that actually for those two bugs, D IFTI works but 
>> after IFTI, the wrong scope is used, or-and that `resolve` is 
>> canceled too early.
>>
>> I dont see how a mediocre language like styx can handle that 
>> while D still cant.
>
> D's IFTI implementation is really, really bad. If you stray 
> even slightly from the "happy path" of conventional, idiomatic 
> code, it completely falls apart. Here's a list of just the bugs 
> that I *personally* have found and reported in D's IFTI:
>
> - https://issues.dlang.org/show_bug.cgi?id=22903
> - https://issues.dlang.org/show_bug.cgi?id=22111
> - https://issues.dlang.org/show_bug.cgi?id=23292
> - https://issues.dlang.org/show_bug.cgi?id=23645
> - https://issues.dlang.org/show_bug.cgi?id=23644
>
> I would not be surprised if a ground-up rewrite of the entire 
> IFTI implementation was necessary to fix all of these issues.

These issues are very specific to the D type system, for example 
I see problem related to type qualifiers.

For the two old issues I mentioned the simple algorithm should 
work. You try to see how the AST of the parameter type and the 
argument type match. You decompose them in paralell. If at some 
point the decomposition of the parameter ends up on an identifier 
and that the identifier matches to a template parameter then it's 
likely that the ident matches to what the paralell decomposition 
of the argument type is at. Simple stupid. As said previously I 
think that the two bugs are not related to IFTI but to the scope 
used to run the typesem... hard to explain it better.

In a world where it would be allowed to bet on software bugs I'd 
bet it's not a IFTI problem and that it's a scope problem. If you 
try to find something that doesn't exist in a scope you wont find 
it.

Anyway 12 years ;)


More information about the Digitalmars-d mailing list