About Mercury

Mercury is a pure logic programming language intended for the creation of large, fast, reliable programs. The syntax of Mercury is based on the syntax of Prolog, but semantically the two languages are very different due to Mercury's purity, its type, mode, determinism and module systems.

The main features of Mercury are:

The Mercury compiler is written in Mercury itself. It was bootstrapped using NU-Prolog and SICStus Prolog. This was possible because after stripping away the declarations of a Mercury program, the syntax of the remaining part of the program is mostly compatible with Prolog syntax.

The Mercury compiler compiles Mercury programs to C, which it uses as a portable assembler. The system can exploit some GNU C extensions to the C language, if they are available: the ability to declare global register variables, the ability to take the addresses of labels, and the ability to use inline assembler. Using these extensions, it generates code that is significantly better than all previous Prolog systems known to us. However, the system does not need these extensions, and will work in their absence.