52 points · by zdw · 3y ago · 41 comments
One of the things that comes up, is that if the error message suggests a change, one of the risks is that such an edit can make the error go away, but the code will not be correct. By making a concrete suggestion, it tempts the programmer to just apply it without thinking.
This is really interesting to me because it makes sense, and goes against many common ideas about how to make good error messages.
"Error messages: diagnostic is preferable to prescriptive" [1] is a riff on a similar theme, though the author of that blog post is focusing on error messages for Microsoft's C# compiler, which are more likely to be intended for experienced professional developers, so he is coming at the problem from a different perspective than the student-focused one of the paper you mentioned.
[1] https://web.archive.org/web/20060720004516/http://blogs.msdn...
I don't hate you I just don't control the whole stack.
Also linkers can tell you where the symbol was referenced if that place has a location in the code. This isn't universal but it's practically always been there for me.
What i also find hard to understand is that generally linkers are "single pass" i.e. you need to feed them objects and libs in the correct order (callers prior to callees) for them to solve all links. Not sure if this requirement still is always there.
Linkers are multiple pass if doing compiler optimisation things. Otherwise they're pretty close to cat + patch some pieces, single pass seems fair.
It's not immediately obvious to me why linkers don't say which functions were making the undefined symbol call. A suspicion is that the linker may not know what the function name is for the corresponding instruction without digging it out of the debug info and the linker probably doesn't have the corresponding parser ready to hand. It probably could narrow it down to a source object file, though libraries make that difficult.
I think that C or C++ were just written by people who never gave a single damn about UX until competition appeared and then things started improving,
C++ had more of a choice about it.
This is irrelevant. The design of a language has little bearing on the quality of the error messages from any particular implementation. In particular, the constraints on C implementations in the '70s is irrelevant to constraints on implementations in 2023. There's absolutely nothing preventing the GCC/LLVM/ICC/MSVC developers from adding better error messages to their compilers, and the design of the language certainly isn't one.
How many years have passed since that time?
What do you mean?
I have multi-decade experience in coding C/C++ but its shameful how much time still gets wasted on these stupid compiler errors.
You don't need an AI you just need the right abstractions in the code.
The AI could help you learn if you really don't understand but for just telling you what went wrong you don't need it. In fact the compiler can already fix a lot of these things for you if they bothered to implement it (see fixit in clang)
"rustc error messages not only describe the error in the code, but for certain error patterns, suggest edits that may fix the problem. However, these edits are always local and don’t provide any high-level design feedback which may be helpful in making the mindshift."
In my experience, that thought is a bright neon sign telling you that you have a potentially killer product on your hands.