1. 4

  2. 2

    Here’s before-and-after pictures of a huge error message overhaul which ReasonML carried out in 2017, as written abbout in their blog post:

    It’s funny, I find the original message easier to read. The “We’ve found a bug for you!” line is unnecessary fluff, the 5 lines of source code are both too much context (a single line makes the problematic statement more obvious) and not enough (I would need to jump to my editor to figure out where data comes from). I don’t know how I feel about the “The incompatible parts” line, I feel it’s slightly redundant but I can’t rule out it being useful for more complex types (but wouldn’t we then be falling into the same “long error messages” trap decried by the paper?). Also, it’s just a matter of taste, but I find the use of We or I by the compiler (or software in general) rather unnerving.

    Currently, most tools print their output to the console or error window as text. However, they could instead output structured output such as JSON, XML […]

    GCC supports -fdiagnostics-format=json. Using this instead of parsing text messages has resulted in a huge quality of life improvement for the people I know who work on IDEs :).