Aviva Directory » Computers & Internet » Programming » Mercury

Developed at the University of Melbourne in 1995, Mercury is a functional logic programming language that was strongly influenced by Prolog.

Led by Zoltan Somogyi, the development team from the university's Computer Science Department included Thomas Conway and Fergus Henderson. Intended as an alternative to Prolog, the language was also influenced by Haskell, Hope, and the ML family of languages. Although the two languages have since diverged, the first versions of Mercury could be described as a subset of Prolog, but with strong types and models.

It has a similar syntax as Prolog, and the same basic concepts, such as the selective linear definite (SLD) clause resolution algorithm. Unlike the implementations of Prolog that were in use at the time, Mercury has a separate compilation phase rather than being directly interpreted. This allows for a wider range of errors to be detected before running a program. Mercury also features a strict static type and mode system, as well as a module system. By using the information obtained at compile-time, Mercury programs can perform faster than equivalent programs written in Prolog.

With several back-ends, Mercury code can be compiled into C, C#, Erlang, or Java. Mercury also includes a foreign language interface that allows code written in other languages to be linked with Mercury code.

The Mercury compiler was entirely written with Mercury.

The official implementation of the language is the Melbourne Mercury Compiler, which is available for Unix and Unix-like platforms, including Linux and macOS, as well as for Windows 32-bit.

The focus of this category is on the Mercury programming language. Resources related to the language itself, any of its implementations, compilers, IDEs, editors, or other tools designed to facilitate programming in Mercury are appropriate for this category, along with Mercury user groups, forums, guides, or tutorials.



Recommended Resources

Search for Mercury on Google or Bing