September 24, 2013
On 9/23/2013 12:19 PM, Timon Gehr wrote:
> There is no such thing as a law that obliges compiler writers to add column
> numbers in debug info when such information is available in frontend error
> messages.

I guarantee that if the error messages have column numbers, people will file bug reports that it doesn't show up in the debugger, and rightfully so.
September 24, 2013
On Tuesday, 24 September 2013 at 20:26:54 UTC, Walter Bright wrote:
> On 9/23/2013 10:33 AM, Iain Buclaw wrote:
>> GCC has a carat too now.
>
> DMC has had a carat for 30 years now.
>
>   int x x;
>         ^
>   test2.c(2) : Error: missing ',' between declaration of 'x' and 'x'
>
> Nobody ever gave a damn about that feature, i.e. not one single person commented on it, including not a single D user.

Maybe that's because "not one single person" actually uses DMC? ;)

I certainly find that feature very helpful in Clang.

David
September 24, 2013
On 9/24/13, Walter Bright <newshound2@digitalmars.com> wrote:
> Nobody ever gave a damn about that feature, i.e. not one single person commented on it, including not a single D user.

It seems nobody comments on almost anything DMC-related anyway. Isn't this the DMC newsgroup: http://forum.dlang.org/group/c++ ? If it is, there's hardly a single post per month..
September 24, 2013
On 9/24/13, David Nadlinger <code@klickverbot.at> wrote:
> Maybe that's because "not one single person" actually uses DMC? ;)

It's like building a bridge in the middle of Siberia and then saying that bridges are useless because hardly a dozen people use it a week.
September 24, 2013
On 9/24/13, Walter Bright <newshound2@digitalmars.com> wrote:
> I worry that this is too complicated to be worthwhile.

Unfortunately yes, the way the compiler is written right now would mean the feature would have to be implemented as a series of hacks. Perhaps if the implementation simplifies or we get another compiler.. :)
September 24, 2013
Walter Bright:

> I worry that this is too complicated to be worthwhile.

After seeing the error messages given by Clang I think it could be worthwhile. In C++ it has saved me debugging time.


> I used to do that, but again, it was a completely unwanted feature, and I
> abandoned it.
> It's simple enough to grep for the error message text, and I myself prefer
> to do the grep method.

At the moment in D learn people show the error messages generated by dmd and don't know what to do. An archive of errors, one error for each wiki page, is useful because the user sees a longer description of the error, plus two examples of it (where it could be recognized better if it's really the right error), plus explanations how to fix it, like to use "const" or "inout" or to use an alias inside a class etc.

The problem with grepping is that it could lead to mistakes, you have to grep for the whole error message, otherwise you risk finding the wrong message. Another problem is that the wording could change, both in different versions of the same compiler and in different compilers, so every compiler needs its own wiki. Also, if you need to use a search, you must have all the error messages in the same page, while with error messages you could just go directly to the page number and you don't need to copy and paste several (all) the words of the error message. Having a standard number across all D compilers allows for a standardization of tools (the IDE has to show the same error tooltips regardless the D compiler you are using). Another advantage of numbers of error messages is that if two different points of the same compiler have to generate the same error, using the same code number there is no risk the error message could go out of sync to each other. This has happened in DMD, where I have seen the same error give different error messages with the same dmd (http://d.puremagic.com/issues/show_bug.cgi?id=11094 ).


> What makes me grumpy is people only want these things when some other
> compiler does it, sort of a bandwagon thing.

I have tried to show, here and in Issue 5004, that's not true. And even if it's just a fashion as you say, I could argue that in computer science and programming there are far worse fashions people cling to. Sometimes when you create an engineering product it's not enough for it to be technically very good, you also have to wrap it in a colourful, fashion-aware and pretty paper. If you miss doing that, you are doing 99% of the necessary work for success but you are missing far more than the 1% of "overall appreciation" for your product.

Bye,
bearophile
September 24, 2013
Andrej Mitrovic:

> Unfortunately yes, the way the compiler is written right now would
> mean the feature would have to be implemented as a series of hacks.
> Perhaps if the implementation simplifies or we get another compiler..
> :)

You could show somewhere what are the implementation simplifications you need to implement that feature cleanly. Perhaps Kenji will be interested. Issue 5004 is not a fashion-based enhancement request. Don't let the status quo stop the improvement of the D compilers :-)

Bye,
bearophile
September 24, 2013
On 09/24/2013 10:48 PM, Walter Bright wrote:
> On 9/23/2013 12:19 PM, Timon Gehr wrote:
>> There is no such thing as a law that obliges compiler writers to add
>> column
>> numbers in debug info when such information is available in frontend
>> error
>> messages.
>
> I guarantee that if the error messages have column numbers, people will
> file bug reports that it doesn't show up in the debugger, and rightfully
> so.

In case the performance argument is valid, no, they would not be right.
September 24, 2013
On 09/24/2013 10:26 PM, Walter Bright wrote:
> On 9/23/2013 10:33 AM, Iain Buclaw wrote:
>> GCC has a carat too now.
>
> DMC has had a carat for 30 years now.
>
>    int x x;
>          ^
>    test2.c(2) : Error: missing ',' between declaration of 'x' and 'x'
>
> Nobody ever gave a damn about that feature, i.e. not one single person
> commented on it, including not a single D user.

You have used lack of comments as an indicator of quality in the past.
September 24, 2013
On 25/09/13 06:29, Walter Bright wrote:
> On 9/23/2013 11:38 AM, bearophile wrote:
>> 2) The other improvement I'd like for D error messages and warnings is
>> to give a
>> standard error number. This is a simple improvement, but it makes
>> simpler to
>> write explanation pages for the errors. The C# compiler and other
>> compilers have
>> them.
>
> I used to do that, but again, it was a completely unwanted feature, and
> I abandoned it.
>
> It's simple enough to grep for the error message text, and I myself
> prefer to do the grep method.
>
> What makes me grumpy is people only want these things when some other
> compiler does it, sort of a bandwagon thing.

Grepping the text can be a problem if the output has been localised.

I write GUI wrappers for programs such as Mercurial/Git/Quilt and have been forced to use the (equivalent) of the grep to obtain details of the failure of a Mercurial/Git/Quilt command in order to add niceties as offering a "refresh and retry" option if (say) a quilt push fails because the repository needs to be refreshed.  The reason that I have to do this is that the error value returned by the commands isn't very useful (usually just 0 for success and -1 for failure).  The downside of this is that if my user has a locale that uses a language other than English my greps fail and the user misses out on the added niceties that would otherwise have been available.

The type of error return value I would have liked to have seen implemented in programs (I asked for changes but none were forthcoming) I write wrappers for would be a flag based system (I think that you can only count on 8 bits in the return value) to indicate the major characteristics of the failure.

Peter