Skip to content
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

GHCi Support #6

Open
friedbrice opened this issue Jul 21, 2022 · 4 comments
Open

GHCi Support #6

friedbrice opened this issue Jul 21, 2022 · 4 comments
Labels
new feature New feature or request

Comments

@friedbrice
Copy link

friedbrice commented Jul 21, 2022

Maybe this is a naive question, but these typechecker plugins work with GHCi as well, right?

Using Ghcid to invoke GHCi with these plugins enabled will provide an IDE-like experience. All that's needed are editor plugins that read the files created by these plugins.

VS Code has something similar already: https://marketplace.visualstudio.com/items?itemName=ndmitchell.haskell-ghcid (And it always works, with any haskell project, and it's a joy to use.)

I think a crucial thing that makes this approach tenable is that it only re-compiles on file saves, so only on discrete, human-initiated times. whereas something like HLS is continually recompiling (IIUC). This saves on system resources so that the computer only does this work when it's relevant to a human operator. (To be honest, I prefer to defer feedback to file saves anyway. I hate it when I'm in the middle of typing and all of a sudden the squiggly red underlines go crazy.)

@friedbrice
Copy link
Author

friedbrice commented Jul 21, 2022

(Having said all that, I can't help but feel bad that we're effectively side-stepping HLS with this plugin approach, right? That just seems kinda wrong.)

@wavewave
Copy link
Collaborator

I would say that the HLS approach and this plugin approach are actually complementary. What HLS does is to provide a global indexing environment over the code base by continuously checking and updating information commonly used. The inspection plugin is intended to provide targeted analysis for a certain feature (in a batch compilation execution). Currently, the workflow I consider as a primary use case is that developers can just turn a specific plugin on for identifying a problem, benchmarking or troubleshooting and turn off the plugin after that. In that vein, one of the closest examples to this plugin toolbox is inspection-testing.

@wavewave
Copy link
Collaborator

How to effectively use ghci with ghc plugin is an interesting use case to explore. Thanks for the note! :-)

@wavewave
Copy link
Collaborator

Currently started to work on this. We found big memory retention in GHCi session after reloading a big module subtree, and want to inspect it on live.

@wavewave wavewave added the new feature New feature or request label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants