
Hi devs, In my work with Alfredo at revising our error message infrastructure, we ran across some code that renders error messages as JSON. Given that our data structures are changing, it seems natural to change the JSON output, too, but it's unclear whether that's wise. The manual currently lists -ddump-json in the chapter on "Debugging the compiler", suggesting that a change is fine, but I'm not yet convinced. So: - Is there someone in charge of -ddump-json? Matthew Pickering authored -ddump-json in https://gitlab.haskell.org/ghc/ghc/-/commit/91691117fc194c525f58ccd5b266dd1d... https://gitlab.haskell.org/ghc/ghc/-/commit/91691117fc194c525f58ccd5b266dd1d.... - Are there clients of -ddump-json? - Is there a specification of -ddump-json? - There will likely be a desire to evolve this feature. What is the process for doing so? Thanks! Richard

Just grepping Github there appears to be a few users of the flag but
no more than a handful. I think you can probably change it how you
like.
Cheers,
Matt
On Thu, Jan 28, 2021 at 8:20 PM Richard Eisenberg
Hi devs,
In my work with Alfredo at revising our error message infrastructure, we ran across some code that renders error messages as JSON. Given that our data structures are changing, it seems natural to change the JSON output, too, but it's unclear whether that's wise. The manual currently lists -ddump-json in the chapter on "Debugging the compiler", suggesting that a change is fine, but I'm not yet convinced.
So: - Is there someone in charge of -ddump-json? Matthew Pickering authored -ddump-json in https://gitlab.haskell.org/ghc/ghc/-/commit/91691117fc194c525f58ccd5b266dd1d.... - Are there clients of -ddump-json? - Is there a specification of -ddump-json? - There will likely be a desire to evolve this feature. What is the process for doing so?
Thanks! Richard

Do we provide any kind of versioning or data schema for the JSON dumps? On 29/01/2021 09:57, Matthew Pickering wrote:
Just grepping Github there appears to be a few users of the flag but no more than a handful. I think you can probably change it how you like.
Cheers,
Matt
On Thu, Jan 28, 2021 at 8:20 PM Richard Eisenberg
wrote: Hi devs,
In my work with Alfredo at revising our error message infrastructure, we ran across some code that renders error messages as JSON. Given that our data structures are changing, it seems natural to change the JSON output, too, but it's unclear whether that's wise. The manual currently lists -ddump-json in the chapter on "Debugging the compiler", suggesting that a change is fine, but I'm not yet convinced.
So: - Is there someone in charge of -ddump-json? Matthew Pickering authored -ddump-json in https://gitlab.haskell.org/ghc/ghc/-/commit/91691117fc194c525f58ccd5b266dd1d.... - Are there clients of -ddump-json? - Is there a specification of -ddump-json? - There will likely be a desire to evolve this feature. What is the process for doing so?
Thanks! Richard
ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
-- Hécate ✨ 🐦: @TechnoEmpress IRC: Uniaika WWW: https://glitchbra.in RUN: BSD

I have filed https://gitlab.haskell.org/ghc/ghc/-/issues/19278 https://gitlab.haskell.org/ghc/ghc/-/issues/19278 to try to get this sorted. Thanks for the quick responses! Richard
On Jan 29, 2021, at 4:02 AM, Hécate
wrote: Do we provide any kind of versioning or data schema for the JSON dumps?
On 29/01/2021 09:57, Matthew Pickering wrote:
Just grepping Github there appears to be a few users of the flag but no more than a handful. I think you can probably change it how you like.
Cheers,
Matt
On Thu, Jan 28, 2021 at 8:20 PM Richard Eisenberg
wrote: Hi devs,
In my work with Alfredo at revising our error message infrastructure, we ran across some code that renders error messages as JSON. Given that our data structures are changing, it seems natural to change the JSON output, too, but it's unclear whether that's wise. The manual currently lists -ddump-json in the chapter on "Debugging the compiler", suggesting that a change is fine, but I'm not yet convinced.
So: - Is there someone in charge of -ddump-json? Matthew Pickering authored -ddump-json in https://gitlab.haskell.org/ghc/ghc/-/commit/91691117fc194c525f58ccd5b266dd1d.... - Are there clients of -ddump-json? - Is there a specification of -ddump-json? - There will likely be a desire to evolve this feature. What is the process for doing so?
Thanks! Richard
ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
-- Hécate ✨ 🐦: @TechnoEmpress IRC: Uniaika WWW: https://glitchbra.in RUN: BSD
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Richard Eisenberg
Hi devs,
In my work with Alfredo at revising our error message infrastructure, we ran across some code that renders error messages as JSON. Given that our data structures are changing, it seems natural to change the JSON output, too, but it's unclear whether that's wise. The manual currently lists -ddump-json in the chapter on "Debugging the compiler", suggesting that a change is fine, but I'm not yet convinced.
I think it would be fine to change the output. However, note that there is a reason why this flag is in the -d flag namespace and the "Debugging the compiler". The output is quite unstructured and we reserve the right to change the representation, largely because it was hard to do better without first fixing #8809. After we have the new rich errors infrastucture in place I think we will be in a much better place to discuss a properly-supported flag (via the proposal process, presumably). However, I think when we do so we should be careful to constrain the scope of the provided output. GHC is not a language server and I don't think it would be wise to make it one. Cheers, - Ben

Hello,
it seems pretty reasonable to change it, but we should change the version
number as well (well, and add it if it is not there). In general, having a
version number is probably good practice for any outward facing machine
readable format.
-Iavor
On Fri, Jan 29, 2021 at 11:51 AM Ben Gamari
Richard Eisenberg
writes: Hi devs,
In my work with Alfredo at revising our error message infrastructure, we ran across some code that renders error messages as JSON. Given that our data structures are changing, it seems natural to change the JSON output, too, but it's unclear whether that's wise. The manual currently lists -ddump-json in the chapter on "Debugging the compiler", suggesting that a change is fine, but I'm not yet convinced.
I think it would be fine to change the output. However, note that there is a reason why this flag is in the -d flag namespace and the "Debugging the compiler". The output is quite unstructured and we reserve the right to change the representation, largely because it was hard to do better without first fixing #8809.
After we have the new rich errors infrastucture in place I think we will be in a much better place to discuss a properly-supported flag (via the proposal process, presumably). However, I think when we do so we should be careful to constrain the scope of the provided output. GHC is not a language server and I don't think it would be wise to make it one.
Cheers,
- Ben _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
participants (5)
-
Ben Gamari
-
Hécate
-
Iavor Diatchki
-
Matthew Pickering
-
Richard Eisenberg