Here’re pointers to Mercury related resources, in no particular order. It’s been updated last time on 2023-01-23. If you have comments or resources to include, I’d like to hear from you. My email address is post at volker-wysk dot de. Or write to the mercury-users mailing list.
The Mercuy team collects all Mercury documentation in a central place. Here it is.
samples directory in the Mercury source code
distribution contains examples for diverse parts of the language.
A page about Mercury limitations.
“The current implementation does not yet completely implement the Mercury language. The main limitations of the current implementation are the following.”
This is a series of (long) blog posts, which range from March to December 2011. Paul Bone writes: “There’s also the blog series, not mine, but more”here’s how to” style writing for Mercury is always good.” The “labels” on the right are a sort of a table of contents.
This are documents meant for developers of the Mercury compiler.
The standard libraries should be first place to look for libraries. They are documented in the Mercury Library Reference Manual (see Documentation, above).
The “extra libraries” are distributed with the Mercury source code.
They are in the
extras subdirectory. It consist of 35
libraries (as of 2022-11-24), that are being held up-to-date with
respect of the latest Mercury compiler. See the README files for
Ondrej has put together some Mercury libraries and called that the Mercury Anarchy Archive. The web site has last been updated in 2007, but it’s still up: https://manarchive.sourceforge.net/
However, the subversion download no longer works. So I’m hosting it here (with Ondrej’s consent): manarchive-code-r84.zip.
It consists of the following packages:
hugemap: “An implementation of map that need not fit in RAM based on tinycdb.”
ice-mercury: “Ice is apparently some linkage of some Ice programming language.”
lib_tools: A collection of code that is meant to complement the standard libraries.
maxent_mint: “A maximum entropy classifier, classical machine learning tool.”
posix: “A Mercury interface to some of the POSIX (Portable Operating System Interface) APIs.” This is (seems like) an extended version of the POSIX “extra” library in the Mercury source distributions. It should be merged with that.
tinycdb: “A very efficient constant database. You feed it with pairs and finalize it, then you can search it, but intended for huge collections.”
mmc-get and the (badly named) “Packages” website have
been an approach to set up a Mercury packages database and distribution
system. It consist of libraries, tools and other programs such as games.
This system seems to be abandoned now. I’ve tried to compile the
mmc-get program, but this failed. However, the following
are the libraries which are registered there, excluding the ones which
are mentioned elsewhere in this collection.
A human-readable form of the full mmc-get database is here. It’s long, so it’s placed on a separate page.
This is a “benchmarking wrapper around getrusage”. See https://github.com/jrfondren/getr-mercury.
This is a little program that downloads and displays documentation from mercurylang.org. See https://github.com/jrfondren/mmc-doc.
Colipa is a command line parser library. The design goals are:
It is hosted on Gitlab: https://gitlab.com/volkerwysk/colipa.
Julien Fischer has 9 Mercury libraries and library bindings on his Github page, as of 2022-11-24. There are libraries for the JSON and CSV formats, bindings of Java things, a library of additional integer types, miscellaneous utilities and more.
Sean Charles has 47 projects (as of 2022-11-24) on his Github page, a couple of which are Mercury related.
Sebastian Godelet has a huge lot of Github projects. Amongst them is a Unicode character database parser and library.
They haven’t tested these in a while, but this are libraries that Mission Critical opensourced:
An “OGG decoder library with no foreign code (used in the audio player demo)”: https://github.com/FlyingJester/fjogg
AlaskanEmily of Transnat Games, has released the following code:
Demonstration of constraint solving/graph optimization using
multi determinism code, useful as a basis for pathfinding
in particular: https://osdn.net/users/alaskanemily/pf/Resistors/wiki/FrontPage
Full code demonstration of opening and playing an ogg/opus file in Mercury: https://github.com/AlaskanEmily/audio_player
A simple Java class that lets you use Mercury lists as sequences in Clojure: https://github.com/AlaskanEmily/Merjure
TransUnit unit testing and mocking library, I’ve used this heavily in my game engine and other libraries and projects: https://osdn.net/projects/transunit/
mmath 2D/3D/Matrix math and algebra library: https://osdn.net/users/alaskanemily/pf/mmath/wiki/FrontPage
Saffron Graphics Framework (2D and 3D renderer for OpenGL on Windows and Unix), including a TGA image reader that has no foreign dependencies, bindings for Win32 (Cygwin and MSVC) and GLX/X11, and input handling. Still pre-release, but has been used in a few of my tech demos: https://osdn.net/users/alaskanemily/pf/Saffron/wiki/FrontPage
Aggregates: bag and set aggregates for Mercury
“This is a module to provide bag and set aggregates for Mercury.
“The motivation for this module is to provide aggregates that are comparable to aggregates provided by Prolog (e.g. XSB and SWI-Prolog) and Datalog (e.g. Soufflé). This suggests working with nondeterministic predicates rather than other data structures.
“This is an exploratory exercise, so that the API is likely to change. In particular, the current API and implementations for the bag_row_number and bag_cum_sum window functions are experimental.”
Mark Clements has written a Mercury module that does Automatic differentiation, including both backwards and forwards differentiation. The module adapts an approach used in https://github.com/qobi/AD-Rosetta-Stone/, with a purely functional implementation.
See mercury-ad: Mercury module for automatic differentiation (on Github) for the code, documentation and some examples.
“I have written a Mercury-only implementation of the Mersenne Twister random number generator. This is a very common and reasonably good pseudo random number generator. For details: https://github.com/mclements/mercury-mt.”
About code that isn’t libraries or tools.
The mmc-get database contains, apart from libraries and tools, also some other code. See above.
Docker is a cross-platform method of sandboxing, packaging and distributing software. See here for an introduction.
Fabrice Nicol is compiling and distributing the Mercury Compiler on a daily basis and is distibuting it as Docker images. This means you don’t need to compile the compiler yourself, when you want the latest and greatest version, and you have set up Docker on your system.
Each Docker image contains both, the latest ROTD version and the latest Git version. He provides three versions of his Docker images, named gentoo4mercruy, ubuntu4mercury and alpine4mercury, which correspond to the Linux distribution with the respective name.
The three versions of Docker images should work under any GNU/Linux 64-bit platform with an appropriate Docker installation.
The name of the GitHub repository refers to the GNU/Linux platform of the Docker guest (respectively, Gentoo, Ubuntu or Alpine), not the host.
The Gentoo distribution is aimed at users who want to build dependencies from source code. The Alpine distribution is aimed at those who would like to test builds against the musl C library or need a more compact image.