The Implementation of Mercury, an Efficient Purely Declarative Logic Programming Language.
Zoltán Somogyi, Fergus Henderson, Thomas Conway · 1994
We introduce Mercury, a new purely declarative logic programming language designed to provide the support that groups of application programmers need when building large programs. Mercury's strong type, mode and determinism systems improve program reliability by catching many errors at compile time. We present a new and relatively simple execution model that takes advantage of the information these systems provide to generate very efficient code. We are developing a prototype compiler which uses this execution model to generate portable C code. Our benchmarks show that the code generated by our experimental implementation is significantly faster than the code generated by mature optimizing implementations of other logic programming languages. 1 Introduction Logic programming languages are theoretically superior to imperative programming languages such as Pascal, C, C++ and Ada because they operate on a higher level. They are declarative, which means they allow the programmer to state...