Quality of errors in DMD
John Colvin via Digitalmars-d
digitalmars-d at puremagic.com
Sun Sep 4 04:16:19 PDT 2016
On Sunday, 4 September 2016 at 10:33:44 UTC, Walter Bright wrote:
> On 9/4/2016 2:17 AM, John Colvin wrote:
>> On Sunday, 4 September 2016 at 05:13:49 UTC, Walter Bright
>> wrote:
>>> On 9/3/2016 7:35 PM, John Colvin wrote:
>>>> In my experience getting a clue as to what is was the
>>>> compiler didn't like is
>>>> very useful. Often the only way I can find a workaround is
>>>> by locating the
>>>> assert in the compiler source and working out what it might
>>>> possibly be to do
>>>> with, then making informed guesses about what
>>>> semi-equivalent code I can write
>>>> that will avoid the bug.
>>>>
>>>> If the assert just had a little more info, it might save me
>>>> a fair amount of
>>>> time.
>>>
>>> If you're willing to look at the file/line of where the
>>> assert tripped, I
>>> don't see how a message would save any time at all.
>>
>> Because the message would give me a clue immediately, without
>> me having to go
>> looking in the compiler source (!). Also, I have a vague clue
>> of how dmd works,
>> because I'm interested,
>
> I don't know why opening a file and navigating to a line would
> consume a fair amount of time.
>
Opening the file isn't the problem, it's understanding the
context in order to get hints as to what confused the compiler.
> > but someone else in my position with a compiler crash in
> > front of them and a deadline to hit isn't going to want to
> have to understand it
> > to find out "oh it's the variadic args marked scope that the
> compiler is messing
> > up on".
>
> I don't think that's realistic. It'd be like me trying to guess
> why I got a kernel panic.
Well I've had to do it, a lot, in order to get work done. I'm not
working out what's wrong with the compiler, I'm just getting a
little more information in order to make better educated guesses
of how to make my code compile.
> As I mentioned before, assert failures are usually the result
> of the last edit one did. The problem is already narrowed down.
Narrowed down a bit. Often I've just done a big refactoring
and/or written a bunch of new code that could (and should) never
compile in any intermediate state. The clues that I get from the
compiler source prove invaluable in working out a path to
something that works without having to scrap a whole bunch of
good work.
More information about the Digitalmars-d
mailing list