4 ms·
> One concern I’ve heard when changing how GCC prints diagnostics is that it might break someone’s script for parsing GCC output Honestly though, who would bui
by favorited 8y ago
> One concern I’ve heard when changing how GCC prints diagnostics is that it might break someone’s script for parsing GCC output
Honestly though, who would build a tool which depends on the (presumably undocumented) text output of another application, and then expect it not to break?
- michaelhoffman 8y agoI've built tools based on undocumented output of other applications because there was no documented way to get the information I needed. I don't expect that these won't break but it certainly doesn't make it less annoying when they do break.
- favorited 8y agoOh sure – the first few years of my tech career involved a lot of scraping data from the websites of enterprise tools because their APIs were either incomplete or nonexistent. It was annoying, but never unexpected.
- TomVDB 8y agoWhen that text output has remained consistent for decades(?) can you really consider it an undocumented format?
- petronio 8y agoYes. It's sort of like using undocumented API calls: even if it's been unchanged for a decade, if it's undocumented it can change at any time without the usual deprecation warnings and versioning considerations. Text output, particularly warnings and notes, isn't usually intentioned to be machine parseable and consistent in the first place, but rather is meant for humans to read and may be changed to be better read by humans at will.
- TomVDB 8y agoGood thing then that it's not an undocumented API. :-) https://gcc.gnu.org/onlinedocs/gnat_ugn/Output-and-Error-Message-Control.html https://gcc.gnu.org/onlinedocs/gnat_ugn/Output-and-Error-Mes...
- fooker 8y agohttps://xkcd.com/1172/ https://xkcd.com/1172/
- WalterGR 8y agoIsn’t that part of the Unix Way? Not expecting it not to break, but building tools that depend on the undocumented text output of other tools that.
- fwip 8y agoMost Unix tools have well-documented output.
- WalterGR 8y agoWhat do you mean by Unix tools, and what do you mean by well-documented? Hypothetical example: can I read only the man pages of GNU’s and all BSD’s `ls`es and from that write a cross-platform tool that parses the output of all of them?
- fwip 8y agoCheck out the section "stdout" of the POSIX standard here: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls...
- hedora 8y agoCompiler error string formats are well-documented. Tools have been relying on the : delimited format mentioned in the article since at least the mid-90’s (probably longer). That makes them even more stable than flavors of the decade like xml or json. In fact, the : delimited compiler error format is so well established that it will probably outlive the json schema the article presents, and maybe even json-as-defacto-standard. I’m not saying the json thing is bad (it provides rich information that will be useful to some tools), but it’s shelf life will probably be much less than 25 years.
- DyslexicAtheist 8y ago> it will probably outlive the json your comment reminds of of a hilarious but very true ringing anecdote here¹ about json and 'The Sins of the Father' :-) ¹ https://news.ycombinator.com/item?id=8708617#8709223 https://news.ycombinator.com/item?id=8708617#8709223