`ghcup` makes it easy to install specific versions of `ghc` on GNU/Linux as well as macOS (aka Darwin), and can also bootstrap a fresh Haskell developer environment from scratch.
*This project was started when [CM](https://github.com/capital-match) was switching from stack to [cabal nix-style builds](https://www.haskell.org/cabal/users-guide/nix-local-build-overview.html).*
Generally this is meant to be used with [`cabal-install`](https://hackage.haskell.org/package/cabal-install), which
handles your haskell packages and can demand that [a specific version](https://cabal.readthedocs.io/en/latest/nix-local-build.html#cfg-flag---with-compiler) of `ghc` is available, which `ghcup` can do.
Installs a specified GHC version into `~/.ghcup/ghc/<ver>`, and places `ghc-<ver>` symlinks in `~/.ghcup/bin/`.
Optionally, an unversioned `ghc` link can point to a default version of your choice.
This uses precompiled GHC binaries that have been compiled on fedora/debian by [upstream GHC](https://www.haskell.org/ghc/download_ghc_8_6_1.html#binaries).
Alternatively, you can also tell it to compile from source (note that this might fail due to missing requirements).
In addition this script can also install `cabal-install`.
Currently only GNU/Linux distributions compatible with the [upstream GHC](https://www.haskell.org/ghc/download_ghc_8_6_1.html#binaries) binaries are supported.
ghcup is not a reimplementation of stack. The only common part is automatic installation of GHC, but even that differs in scope and design.
2. Why not contribute to stack and create a library for the common part?
While this might be an interesting idea, ghcup is about simplicity.
3. Why write a >1000k LOC bash script?
ghcup is POSIX sh.
4. Why write a >1000k LOC POSIX sh script?
Mainly because the implementation is fairly straight-forward and the script is highly portable. No need to bootstrap anything or set up yet another CI to build ghcup binaries for all possible arches and distros just to perform a very simple task: identify distro and platform and download a GHC bindist.
Consider using [Chocolatey](https://chocolatey.org/search?q=ghc). Also see [#114](https://gitlab.haskell.org/haskell/ghcup/issues/114) for a discussion.