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

Support cabal ghci as an alias for cabal repl #8946

Open
geekosaur opened this issue May 10, 2023 · 6 comments
Open

Support cabal ghci as an alias for cabal repl #8946

geekosaur opened this issue May 10, 2023 · 6 comments

Comments

@geekosaur
Copy link
Collaborator

Describe the bug
repl may be fine for those in the know, but is often obscure to newcomers.

System information

  • Linux skkukuk 5.15.0-71-generic cabal-get should install packages locally #78~20.04.1-Ubuntu SMP Wed Apr 19 11:26:48 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • cabal-install version 3.10.1.0
    compiled using version 3.10.1.0 of the Cabal library
  • The Glorious Glasgow Haskell Compilation System, version 9.2.7
@ulysses4ever
Copy link
Collaborator

That's a fine idea (and stack implements it, which is a good example to follow), although I believe this kind of redundancy brings its own confusions. E.g. someone just learns about cabal in general and cabal repl, then reads some manual that uses cabal ghci: they're left with a question if this is the same thing. People not used to read manuals may spend some energy on finding the answer...

Mind you, we also have cabal exec -- ghci, which some people find useful.

Perhaps, the downsides are still outweighed by the advantages, so I'd approve such a PR if it is submitted...

@fgaz
Copy link
Member

fgaz commented May 11, 2023

Technically repl is supposed to be compiler-independent, even though currently only GHC(JS) is supported:

-- | Start an interpreter without loading any package files.
startInterpreter :: Verbosity -> ProgramDb -> Compiler -> Platform
-> PackageDBStack -> IO ()
startInterpreter verbosity programDb comp platform packageDBs =
case compilerFlavor comp of
GHC -> GHC.startInterpreter verbosity programDb comp platform packageDBs
GHCJS -> GHCJS.startInterpreter verbosity programDb comp platform packageDBs
_ -> die' verbosity "A REPL is not supported with this compiler."

edit: alternatively we could make it show a message "maybe you meant to use cabal repl"

@geekosaur
Copy link
Collaborator Author

Realistically, though, there isn't another Haskell implementation (hugs is still around but the only effort put into it is to keep it compiling, it hasn't been updated since 2006) and with wide use of ghc extensions it's unlikely there will be a practical alternative any time soon. This mattered more when hugs and nhc98 were around.

@michaelpj
Copy link
Collaborator

Having more than one way to do the same thing often causes a lot of confusion.

@philderbeast
Copy link
Collaborator

Cheeky comment. For the non-bilingual, have stack-cabalish and cabal-stackish as a babel-fishy command layer.

@geekosaur
Copy link
Collaborator Author

Somewhat less cheekily, this seems like a good candidate for #7825 (comment)?

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

No branches or pull requests

5 participants