[m-users.] Mercury Development Docker, and Bisecting Debugger?

Peter Wang novalazy at gmail.com
Tue Dec 21 11:34:58 AEDT 2021


On Fri, 17 Dec 2021 09:18:39 -0500 Prolog Rules <prologrules at gmail.com> wrote:
> Hello! Is there a docker container/image I can pull so I can work with an
> already set-up Mercury compiler? I'm trying to play with mercury and I
> remember setting up the mercury compiler on another computer a few years
> ago was an arduous process. I downloaded the source code today and saw a
> README.docker file so I assume it's possible there is a docker container
> (or would it be image in this case sorry I'm still new to docker
> terminology) that probably has a mercury compiler and dev tools already set
> up?

I can't help you with Docker.

Installing Mercury from a release tarball on Linux (and probably MacOS)
is not hard, even if it can take a while. You need to run:

    ./configure --prefix=/WHERE-YOU-WANT-IT \
	--enable-libgrades=LIST-OF-GRADES
    make PARALLEL=-j8 install

The configure script will default to many more grades than you will
actually use when just starting out. I suggest starting with list of
grades:

    asm_fast.gc,hlc.gc,asm_fast.gc.decldebug.stseg

asm_fast.gc.decldebug.stseg is the one you will need to use the
declarative debugger. You can always install more grades later.

> I'm eager to test out Mercury for its own sake and I also really want
> to try out Mercury's bisecting debugger. I always wanted to try that since
> I saw Michael Hendricks' 2014 Strange Loop talk "Production Prolog". Also
> I'm curious if I should expect to be underwhelmed by the bisecting
> debugger.

The problems with the declarative debugger are practical. In a real
program, the debugger will ask you questions about some huge terms to
decide if a call is correct, incorrect or inadmissible. Even if you know
where to look, the relevant parts of the term will be elided, or hard to
spot within a screen full of other irrelevant information, so you have
to manually drill down into the term using the rudimentary interface
provided. This gets very tedious.

Furthermore, values in mutable or global variables, or values of foreign
types, cannot be printed out within the debugger. This is also a sore
point for the procedural debugger, but worse for the declarative
debugger because you cannot rely on context.

Peter


More information about the users mailing list