macOS
brew install ghclocal Homebrew formula metadata
安装
brew install ghclocal Homebrew formula metadata
sudo apk add ghcAlpine Linux edge package indexes · ghc · 来源: dl-cdn.alpinelinux.org
sudo dnf install ghcFedora Rawhide package metadata · ghc · 来源: dl.fedoraproject.org
nix profile install nixpkgs#ghcnixpkgs package indexes · ghc · 来源: raw.githubusercontent.com
sudo pacman -S ghcArch Linux sync databases · ghc · 来源: geo.mirror.pkgbuild.com
sudo zypper install ghcopenSUSE Tumbleweed package metadata · ghc · 来源: download.opensuse.org
choco install ghcChocolatey community package catalog · ghc · 来源: community.chocolatey.org
概览
Glorious Glasgow Haskell Compilation System
历史
The Glasgow Haskell Compiler, usually called GHC, is the reference-grade open-source compiler and interactive environment for Haskell. It supplies the `ghc` compiler, the GHCi interpreter, package tools such as `ghc-pkg`, documentation tooling such as Haddock, and runtime-system support for profiling, parallelism, and native-code execution.
GHC began at the University of Glasgow near the beginning of the 1990s as an academic research project funded by the UK government. Its stated goals were practical as well as academic: make a robust and portable Haskell compiler freely available, provide a modular foundation for compiler research, and learn from real programs.
The compiler evolved into a self-hosted Haskell implementation with three major pieces: the compiler, boot libraries, and the runtime system. The runtime system became central to GHC's identity because it handles garbage collection, scheduling, profiling, exceptions, and the execution machinery linked into compiled Haskell programs.
GHC became the dominant implementation around which the Haskell ecosystem organized. The AOSA chapter by Simon Marlow and Simon Peyton Jones described hundreds of thousands of downloads, thousands of Hackage packages, undergraduate teaching use, and commercial use; the GHC site likewise points users to Hackage libraries, Haskell Language Server, Cabal, Stack, and GHCup.
The Homebrew `ghc` formula packages the general GHC track for macOS users, while separate versioned formulae let projects select older or branch-specific compiler lines. That split mirrors the way Haskell projects often pin compiler versions because language extensions, boot libraries, and package ABI compatibility can matter.
Practitioners use `ghc` for batch compilation, `ghci` for interactive development, `runghc` or `runhaskell` for scripts, `ghc-pkg` for package database inspection, and Haddock for API documentation. The user guide presents GHC as one program that can operate as either an interactive interpreter or a batch compiler.
Build tools such as Cabal and Stack commonly invoke GHC rather than requiring users to call every compiler flag by hand. Advanced users still care about GHC flags directly for optimisation, profiling, language extensions, cross-platform builds, and debugging package database or linker issues.
GHC is package-manager significant because it is both a compiler and a dependency root for much of the Haskell toolchain. Installing the formula affects not only `ghc`, but also GHCi, boot libraries, package metadata, Haddock, profiling tools, and the versioned executable names that allow scripts to target a specific compiler.
The project also embodies a classic language-runtime packaging problem: the compiler is written in Haskell and needs an existing GHC to build, while libraries compiled by one branch may need rebuilding for another. Versioned formulae, GHCup metadata, and project-level pinning all grew around those realities.
安全态势
compiler and runtime ecosystem.
yellow 风险 · 高 置信度 · runtime
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
ghc | cli | 全局可执行文件 | |
ghc-9.14.1 | cli | 全局可执行文件 | |
ghc-pkg | cli | 全局可执行文件 | |
ghc-pkg-9.14.1 | cli | 全局可执行文件 | |
ghci | cli | 全局可执行文件 | |
ghci-9.14.1 | cli | 全局可执行文件 | |
haddock | cli | 全局可执行文件 | |
haddock-ghc-9.14.1 | cli | 全局可执行文件 | |
hp2ps | cli | 全局可执行文件 | |
hp2ps-ghc-9.14.1 | cli | 全局可执行文件 | |
hpc | cli | 全局可执行文件 | |
hpc-ghc-9.14.1 | cli | 全局可执行文件 | |
hsc2hs | cli | 全局可执行文件 | |
hsc2hs-ghc-9.14.1 | cli | 全局可执行文件 | |
runghc | cli | 全局可执行文件 | |
runghc-9.14.1 | cli | 全局可执行文件 | |
runhaskell | cli | 全局可执行文件 | |
runhaskell-9.14.1 | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
安装元数据
| 软件包键 | brew:ghc |
|---|---|
| 版本 | 9.14.1 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/ghc |
| 主页 | https://haskell.org/ghc/ |
| 仓库 | https://gitlab.haskell.org/ghc/ghc |
| 上游文档 | https://downloads.haskell.org/ghc/9.14.1/docs/users_guide |
| 许可证 | BSD-3-Clause |
| 源码归档 | https://downloads.haskell.org/~ghc/9.14.1/ghc-9.14.1-src.tar.xz |
| 最后更新 | 2026-06-25T13:37:42+02:00 |
| Pulse | updated |
| 依赖 | gmp |
| 构建依赖 | autoconf, automake, python@3.14, sphinx-doc, xz |
| macOS 提供的库 | libffi, ncurses |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 已定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | ghc |
| Aliases |
|
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
ghc 9.6.6-4
The Glasgow Haskell Compilation system
sudo apt install ghcghc-doc 9.6.6-4
Documentation for the Glasgow Haskell Compilation system
sudo apt install ghc-docghc-prof 9.6.6-4
Profiling libraries for the Glasgow Haskell Compilation system
sudo apt install ghc-profghc
nix profile install nixpkgs#ghcghc 9.4.7-3
The Glasgow Haskell Compilation system
sudo apt install ghcghc-doc 9.4.7-3
Documentation for the Glasgow Haskell Compilation system
sudo apt install ghc-docghc-prof 9.4.7-3
Profiling libraries for the Glasgow Haskell Compilation system
sudo apt install ghc-profghc 9.10.3-r2
The Glasgow Haskell Compiler
sudo apk add ghcghc-dev 9.10.3-r2
The Glasgow Haskell Compiler (development files)
sudo apk add ghc-devghc-doc 9.10.3-r2
The Glasgow Haskell Compiler (documentation)
sudo apk add ghc-docghc 9.10.3-155.fc45
Glasgow Haskell Compiler
sudo dnf install ghcghc-Cabal 3.12.1.0-155.fc45
Haskell Cabal library
https://hackage.haskell.org/package/Cabal
sudo dnf install ghc-Cabalghc-Cabal-devel 3.12.1.0-155.fc45
Haskell Cabal library development files
sudo dnf install ghc-Cabal-develghc-Cabal-doc 3.12.1.0-155.fc45
Haskell Cabal library documentation
sudo dnf install ghc-Cabal-docghc-Cabal-prof 3.12.1.0-155.fc45
Haskell Cabal profiling library
sudo dnf install ghc-Cabal-profghc-Cabal-syntax 3.12.1.0-155.fc45
Haskell Cabal-syntax library
https://hackage.haskell.org/package/Cabal-syntax
sudo dnf install ghc-Cabal-syntax来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.