What do you want to see for a mature DLang?
vit
vit at vit.vit
Fri Dec 29 09:44:34 UTC 2017
On Friday, 29 December 2017 at 07:53:51 UTC, IM wrote:
> I will start:
>
> -- Better compiler errors, better compiler errors, better
> compiler errors.
>
>
> I really wish that the compiler errors could receive some
> refinement. Mostly it feels like some error text just being
> thrown at me. It needs to be better formatted, more helpful,
> with suggestions about how to fix (if possible).
>
> To illustrate my point:
>
> - See the compile errors I've just encountered with DMD:
> https://cdn.pbrd.co/images/H0q609l.png
>
> - Now compare that with an error produced by rustc:
> https://cdn.pbrd.co/images/H0q6bLi.png
>
>
> Simple things like these make a big difference. D Lang has been
> around for a long while now, and hence signs of its maturity
> has to show everywhere, especially in the compiler, as well as
> the package manager.
Similar problem is when some template with alias callback fail to
instantiate because callback contains error.
Example:
void foo(){
string str = 1;
/++ nice error message:
Error: cannot implicitly convert expression `1` of type
`int` to `string`
+/
import std.algorithm;
[1, 2, 3].each!((x){
string str = 1 ///same error
});
/++ horrible error message without root cause:
source\app.d(660,14): Error: template app.foo.each!((x)
{
string str = 1;
}
).each cannot deduce function from argument types !()(int[]),
candidates are:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\iteration.d(899,10): app.foo.each!((x)
{
string str = 1;
}
).each(Range)(Range r) if (!isForeachIterable!Range &&
(isRangeIterable!Range || __traits(compiles,
typeof(r.front).length)))
C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\iteration.d(934,10): app.foo.each!((x)
{
string str = 1;
}
).each(Iterable)(auto ref Iterable r) if
(isForeachIterable!Iterable || __traits(compiles,
Parameters!(Parameters!(r.opApply))))
+/
}
More information about the Digitalmars-d
mailing list