News for hackers. Stuff that matters.
Re:Do Developers Read Compiler Error Messages? [pdf] by throw_m239339 on Saturday July 31, 2021 @09:34AM (#28017999)
Tangential to that discussion:

Please, compiler engineers, ALLOW the developer to output stack traces in a structured format. It doesn't matter if it's XML, JSON, YAML, whatever. Please allow the developer to configure the compiler so that when a compiled program yields an error, the error isn't some series of random tabbed lines, but something structured that can then be easily processed.

Re:Do Developers Read Compiler Error Messages? [pdf] by random_upvoter on Saturday July 31, 2021 @03:08PM (#28020798)
As someone who at one time wrote a parser for the error output of gcc, clang AND cl, I can only upvote this tenfold. It was a minor nightmare with a ton of special cases, and the final result was a heuristic rather than a formally sound method. Even determining which lines of the output belonged to the same error message was a challenge. Suffice to say that no fun was had.
Re:Do Developers Read Compiler Error Messages? [pdf] by ghoward on Saturday July 31, 2021 @03:41PM (#28020996)
Thank you for this. I am writing a compiler, and I have never thought about this before. I'll make sure my compiler can do this.

Any format you have a preference for?

Re:Do Developers Read Compiler Error Messages? [pdf] by random_upvoter on Saturday July 31, 2021 @06:13PM (#28021972)
Great that you would consider this! The format doesn't matter all that much to me... JSON is the thing of the moment, seems the most obvious choice. XML would be fine too.
Re:Do Developers Read Compiler Error Messages? [pdf] by ghoward on Sunday August 01, 2021 @04:19PM (#28029513)
Sounds great. Maybe I'll do multiple because each person has their own preference. I mean, it shouldn't be that hard to do multiple...
Re:Do Developers Read Compiler Error Messages? [pdf] by bluejekyll on Saturday July 31, 2021 @10:03AM (#28018215)
I’m guessing most new languages are moving in this direction? rustc for example allows for different formatters, here’s the setting for enabling Json output: https://doc.rust-lang.org/rustc/json.html
Re:Do Developers Read Compiler Error Messages? [pdf] by jimktrains2 on Saturday July 31, 2021 @09:49AM (#28018104)
It's that what the language server protocol is aiming to do?
Re:Do Developers Read Compiler Error Messages? [pdf] by W-_-D on Saturday July 31, 2021 @09:57AM (#28018167)
Not for standalone CLI utils - the LSP is more about powering IDE clients. You could author a CLI that invokes LSP under the hood, but there's no need to tie the output format to that dictated by the LSP.