# Install mercury with Homebrew, apk, MacPorts, Nix, winget, zypper

Logic/functional programming language. Version 22.01.8 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:mercury
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install mercury
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install mercury
```

  Evidence: MacPorts ports tree: lang/mercury/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add mercury
```

  Evidence: Alpine Linux edge package indexes: mercury from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#mercury
```

  Evidence: nixpkgs package indexes: pkgs/by-name/me/mercury/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install lua-lmod
```

  Evidence: openSUSE Tumbleweed package metadata: lua-lmod from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

### Windows

- winget (92%):

```sh
winget install --id Alex313031.Mercury -e
```

  Evidence: Windows Package Manager source index: Alex313031.Mercury from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:mercury
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/mercury>
- **Version:** 22.01.8
- **Source summary:** Logic/functional programming language
- **Homepage:** <https://mercurylang.org/>
- **Repository:** <https://github.com/Mercury-Language/mercury>
- **Upstream docs:** <https://mercurylang.org/documentation/documentation.html>
- **License:** GPL-2.0-only AND LGPL-2.0-only AND MIT
- **Source archive:** <https://dl.mercurylang.org/release/mercury-srcdist-22.01.8.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- c2init (cli)
- canonical_grade (cli)
- info_to_mdb (cli)
- mcov (cli)
- mdb (cli)
- mdemangle (cli)
- mdice (cli)
- mdprof (cli)
- mdprof_cgi (cli)
- mdprof_create_feedback (cli)
- mdprof_dump (cli)
- mdprof_report_feedback (cli)
- mdprof_test (cli)
- mercury (cli)
- mercury_compile (cli)
- mercury_config (cli)
- mercury_profile (cli)
- mercury_update_interface (cli)
- mfiltercc (cli)
- mfilterjavac (cli)
- mgnuc (cli)
- mkfifo_using_mknod (cli)
- mkinit (cli)
- ml (cli)
- mmake (cli)
- mmc (cli)
- mprof (cli)
- mprof_merge_runs (cli)
- mslice (cli)
- mtags (cli)
- mtc (cli)
- mtc_diff (cli)
- mtc_union (cli)
- prepare_install_dir (cli)
- vpath_find (cli)
- c2init (alias)
- canonical_grade (alias)
- info_to_mdb (alias)
- mcov (alias)
- mdb (alias)
- mdemangle (alias)
- mdice (alias)
- mdprof (alias)
- mdprof_cgi (alias)
- mdprof_create_feedback (alias)
- mdprof_dump (alias)
- mdprof_report_feedback (alias)
- mdprof_test (alias)
- mercury (alias)
- mercury_compile (alias)
- mercury_config (alias)
- mercury_profile (alias)
- mercury_update_interface (alias)
- mfiltercc (alias)
- mfilterjavac (alias)
- mgnuc (alias)
- mkfifo_using_mknod (alias)
- mkinit (alias)
- ml (alias)
- mmake (alias)
- mmc (alias)
- mprof (alias)
- mprof_merge_runs (alias)
- mslice (alias)
- mtags (alias)
- mtc (alias)
- mtc_diff (alias)
- mtc_union (alias)
- prepare_install_dir (alias)
- vpath_find (alias)

## Dependencies

- openjdk

## Uses from macOS

- libedit

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 22.01.8
- Local data: ok
- Upstream repository: https://mercurylang.org/
- info: No package-manager update timestamp was available.
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

Mercury is a pure logic programming language that grew out of the University of Melbourne logic-programming research community. The Mercury project describes the language as Prolog-like in syntax but different in semantics because of its purity and its static type, mode, determinism, and module systems. Early papers by Zoltan Somogyi, Fergus Henderson, and Thomas Conway documented the implementation in 1994 and presented Mercury as an efficient purely declarative logic language in 1995.

### Project history

The compiler became a substantial part of the project identity: it is written in Mercury, was bootstrapped from Prolog systems, and compiles Mercury code through C as a portable assembler while using GNU C extensions when available for better code generation. The user guide exposes a full development toolchain around `mmc`, `mmake`, debugging, profiling, generated interface files, and multiple target-language grades.

### How it is used

In package-manager terms, the Homebrew package is a language runtime and compiler suite rather than a small single-command utility. It installs the compiler, build tools, debugger, profiler, and support commands used to compile and inspect Mercury programs. Its niche is close to Prolog and functional-language systems: users pick it when they want logic programming with stronger compile-time guarantees, determinism checking, and efficient native-code-oriented compilation.

### Sources

- <https://formulae.brew.sh/formula/mercury>
- <https://mercurylang.org/about.html>
- <https://mercurylang.org/documentation/papers.html>
- <https://mercurylang.org/information/doc-latest/mercury_user_guide/index.html>


## Security Notes

generalized runtime or code generation signal.

- **Geiger risk:** yellow / medium
- generalized runtime or code generation signal

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** mercury
- **Version Scheme:** 0
- **Revision:** 1
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Nix - mercury: normalized package name match | nixpkgs package indexes: pkgs/by-name/me/mercury/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - mercury - 22.01.8-r1: normalized package name match | Alpine Linux edge package indexes: mercury from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Compiler for the Mercury language | https://www.mercurylang.org
- apk - mercury-doc - 22.01.8-r1: normalized package name match | Alpine Linux edge package indexes: mercury-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Compiler for the Mercury language (documentation) | https://www.mercurylang.org
- apk - mercury-libs - 22.01.8-r1: normalized package name match | Alpine Linux edge package indexes: mercury-libs from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Mercury shared library (libraries) | https://www.mercurylang.org
- MacPorts - mercury: normalized package name match | MacPorts ports tree: lang/mercury/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- winget - Alex313031.Mercury: normalized package name match | Windows Package Manager source index: Alex313031.Mercury from https://cdn.winget.microsoft.com/cache/source.msix
- MacPorts - ml: installed executable or alias match | MacPorts ports tree: math/ml/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- zypper - lua-lmod - 8.7.55-4.3: installed executable or alias match | openSUSE Tumbleweed package metadata: lua-lmod from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Lua-based Environment Modules used in HPC | https://github.com/TACC/Lmod


## Related links

- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [openjdk](https://www.automicvault.com/pkg/brew/openjdk/) - Runtime dependency declared by Homebrew.
- [coconut](https://www.automicvault.com/pkg/brew/coconut/) - Shares av.db curated category or tags: cli, compiler, functional-programming, language-runtime, programming-language.
- [flix](https://www.automicvault.com/pkg/brew/flix/) - Shares av.db curated category or tags: cli, functional-programming, language-runtime, logic-programming, programming-language.
- [frege](https://www.automicvault.com/pkg/brew/frege/) - Shares av.db curated category or tags: cli, compiler, functional-programming, language-runtime, programming-language.
- [idris2](https://www.automicvault.com/pkg/brew/idris2/) - Shares av.db curated category or tags: cli, compiler, functional-programming, language-runtime, programming-language.
- [koka](https://www.automicvault.com/pkg/brew/koka/) - Shares av.db curated category or tags: cli, compiler, functional-programming, language-runtime, programming-language.
- [never](https://www.automicvault.com/pkg/brew/never/) - Shares av.db curated category or tags: cli, compiler, functional-programming, language-runtime, programming-language.
- [purescript](https://www.automicvault.com/pkg/brew/purescript/) - Shares av.db curated category or tags: cli, compiler, functional-programming, language-runtime, programming-language.
- [urweb](https://www.automicvault.com/pkg/brew/urweb/) - Shares av.db curated category or tags: cli, compiler, functional-programming, language-runtime, programming-language.

## Combined YAML source

View the package source record on GitHub. [combined/mercury.yml](https://github.com/automic-vault/db/blob/main/combined/mercury.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
