Quality of errors in DMD

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 2 15:26:11 PDT 2016


On Fri, Sep 02, 2016 at 02:52:57PM -0700, Walter Bright via Digitalmars-d wrote:
[...]
> I understand your concern, and that's why we put a priority on fixing
> asserts that are submitted to bugzilla. But without a bug report, we
> are completely dead in the water in fixing it. It is supposed to never
> happen, that is why we cannot fix them in advance.

What *would* help greatly is if, upon encountering an unexpected
problem, the compiler told the user something to the effect of "hey
there, I'm really sorry but apparently I've run into a problem I don't
know how to solve; could you please file a bug report at $URL so that
the compiler authors look into the problem?"  Instead of blurting out
something in encrypted Klingon that nobody understands, like
"backend/gjqzx.c 12345 phlebotinum overload".

OK, I exaggerate, but seriously, to anyone unfamiliar with compiler
internals, dmd asserts might as well be talking about phlebotinum
overloads and they couldn't tell the difference.  If the error message
isn't being helpful, the chances of a bug report being filed are pretty
low, which means the chances of the problem getting fixed is even lower.

I think this PR would go a long way at making dmd friendlier to new D
users, if we can figure out how to make it work for all asserts
including from C code:

	https://github.com/dlang/dmd/pull/6103


> Using dustmite is a practical way to reduce the source code to a
> manageable size.

A user wouldn't even know what dustmite is, let alone that it exists and
is applicable to this situation, or where to find it and how to use it,
unless they were told. Preferably by the compiler before it terminates
with an assert error. ;-)


> Having a compiler stack trace or it dumping its internal variables is
> unlikely to help anyone but the compiler devs.
[...]

Stack traces or internal variable dumps are equally unhelpful as the
current phlebotinum overload abort messages.  What we need is for the
compiler to tell the user (1) this is a compiler bug, not some fault in
their own code; (2) where to report this bug so that there's actually a
chance the problem will get fixed; (3) what is dustmite, where to find
it, and how it would help in formulating a bug report. And optionally,
(4) where to go to ask for help if you really need to find some way to
work around a compiler bug and get your code working again (e.g.,
forum.dlang.org).

If I were to run some random program downloaded off the 'net and it came
back to me with:

	phlebo/tinum.c 12345 zyxqwqyb error

with no information about (1), (2), or (3), chances are pretty high that
I would just delete the program and move on to something else. I
wouldn't bother spending the effort to find out where to file bug
reports, and the problem will likely go unfixed and it will continue to
turn off yet more would-be users.

We need to get PR 6103 off the ground.


T

-- 
Let's eat some disquits while we format the biskettes.


More information about the Digitalmars-d mailing list