3 ms·
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, JS
by throw_m239339 5y ago
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.
- jimktrains2 5y agoIt's that what the language server protocol is aiming to do?
- W-_-D 5y agoNot 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.
- bluejekyll 5y agoI’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 https://doc.rust-lang.org/rustc/json.html
- random_upvoter 5y agoAs 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.
- ghoward 5y agoThank 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?
- random_upvoter 5y agoGreat 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.
- ghoward 5y agoSounds great. Maybe I'll do multiple because each person has their own preference. I mean, it shouldn't be that hard to do multiple...