From a developer’s perspective one of those basics I need is a watcher that reloads rapidly on any change I make on the code base and reruns all the tests. I dare to say it’s standard for many to develop in such a fashion.
Yet it was surprisingly long and difficult until I finally learned the right command:
Of course this is a special cabal repl call using ghcid.
Why isn’t this a builtin command within cabal?
What does it take to make it one?
I mean, there is value in language extensions but I feel what people need is stuff like this. Basic things that simplify their development experience.
I hold off from filing an issue of this before understanding the landscape properly. An issue should not be a discussion. It should be a complete requirement.
(Also, I was surprised to see that there is not really a category for this one this discourse).
For the long haul: Which other basic things bring high practical value to the common developer yet don’t exist for Haskell?
I mean, has anyone compiled a table of current languages and their tooling comparing it with Haskell’s?
I think it’s a good idea. The Cabal project has a Proposals process, so I’d encourage you to draft one. I’d be in favour of more integrated tooling within cabal-install, especially since it puts us less at risk of suffering from unmaintained third-party tools (like ghciwatch).
Funny you should ask. I’ve been wondering the same thing.
FWIW here’s my current default invocation, suitable(?) for multi-package projects, including some cargo-culting from a plain ‘ghcid’'s invocation of ghci:
Yeah, this is one of the more embarrassing ecosystem gaps IMO. I have so many variations of horrible scripts using ghcid and ghciwatch (both of which have their own awkward bugs and limitations), for stuff that really should be pretty simple.
There is quite a big design space, and probably a lot of fixes across various parts of the stack. Plus discussions to be had about which logic belongs in Cabal versus GHCI versus an external tool. It’s all doable. It just needs someone motivated to take it on. Adding support in Cabal itself has been proposed at least once here, so that could be the place to start.
What I personally want is to be able to go in to a big multi-component Cabal project and just run cabal watch 'some compound expression' and have that expression get re-evaluated precisely when GHC detects that its dependencies have changed. (I’d previously wanted a more REPL-based approach, with a :watch command in GHCI, but the main reason for that was not wanting to wait to reload the whole session just to change the expression I want to watch, and that concern should be becoming obsolete due to the work on serialisable bytecode and making Cabal spend less time unnecessarily reconfiguring stuff.)
FWIW, I’m currently working on a file watching tool specifically for Obelisk, with separate REPL processes for the backend and the Wasm frontend. I’ll try to upstream what I can to GHCI etc.
Haskell Foundation tech proposals are the correct place to request funding for such things (after you’ve of course cleared the details with the Cabal project)