Skip to content

Find alternative to parsing GHCi output #1570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bgamari opened this issue Nov 6, 2017 · 3 comments
Open

Find alternative to parsing GHCi output #1570

bgamari opened this issue Nov 6, 2017 · 3 comments

Comments

@bgamari
Copy link

bgamari commented Nov 6, 2017

Currently haskell-mode seems to rely on a pile of rather fragile regular expressions for getting information out of GHCi. However, GHCi is not intended to be a language server; rather, it is a REPL for use by humans. As such, the GHC developers reserve the right to change output freely to improve ghci's usability for its intended purpose.

Unfortunately, when we exercise that right we end up with situations like #1553. The solution is here is clear: let's define a machine-readable interface. Perhaps it will be part of ghci or perhaps not. But let's begin the discussion. What does haskell-mode need out of GHCi to work robustly and avoid parsing-by-way-of-regular-expression?

In the case of #1553 I have introduced a flag reverting the output to the previous behavior. However, be aware that I would like to deprecate this flag soon; let's starting feeling out alternatives so I can do that.

@hvr
Copy link
Member

hvr commented Nov 7, 2017

To be fair, there are already a handful of GHCi commands which are intended to be used by machines which I either implemented or ported myself to GHCi (and whose output was designed with a connsumer such as Emacs in mind), and whose output is thus properly specified in the user's guide. This of course doesn't apply to the screen-scraping @bgamari is referring to.

Consequently I'd claim, that every command whose output isn't explicitly defined in the user's guide is subject to change w/o prior notice.

@bgamari
Copy link
Author

bgamari commented Nov 7, 2017 via email

@bgamari
Copy link
Author

bgamari commented Jul 31, 2018

For the record, I have opened a GHC ticket where we can collect design ideas. Please do chime in; we would love to improve GHC's tooling story but we need your input to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants