This question is related to, but not the same as, What are some ways of reporting compilation errors? as that questions gets into the design of handling compiler errors at the compiler level (and the answer there gives personal examples of their approach to handling them). This question is more of a philosophical one regarding how far one needs to go when offering information about a compiler error.
Rust has a reputation for extremely helpful compiler error messages, going so far as to point out the specific portion of a line that's problematic as well as suggestions to fix the error. Those suggestions sometimes perfectly account for a programmer's intentions and offer correct solutions to them.
These advanced explanations are not very common in programming compilers, and when designing a programming language, I'm curious how important it would be to sink all that time into supporting such a robust compiler error handler, or whether the seemingly much more common approach of "Solid explanatory error message with supporting documentation" is sufficient.
To narrow this down a little bit further, my intent would be to target an audience that should, ideally, have a fair bit of programming knowledge from other languages prior to starting this language's use (i.e. I don't expect this to be that discoverable or as accessible to new programmers given its scope) and am weighing my options as it pertains to the work I would put into this sort of feature.
std::string
,std::vector
, and/orstd::ostream
in C++ (or with template types in general), or especially troubleshooting anything that involves SFINAE. Error messages can easily devolve into borderline gibberish if you don't know how templates work, and even then they can still be hard to parse, and that's with compilers trying to make them helpful. I'd hate to imagine what it'd be like with anything less helpful! $\endgroup$You lied to me when you told me this was a program
’.” — Pete Fenelon. And a more widely-available one: by default, the Unix line editored
indicates all errors by displaying a single?
, as ‘the experienced user will know what is wrong’ (though later versions can show more descriptive error messages on request). $\endgroup$