From ok@atlas.otago.ac.nz  Tue Mar 14 01:42:56 2000
Received: from atlas.otago.ac.nz (atlas.otago.ac.nz [139.80.32.250])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id BAA11913
	for <prolog@swi.psy.uva.nl>; Tue, 14 Mar 2000 01:42:54 +0100 (MET)
Received: (from ok@localhost)
	by atlas.otago.ac.nz (8.9.3/8.9.3) id NAA18676;
	Tue, 14 Mar 2000 13:41:59 +1300 (NZDT)
Date: Tue, 14 Mar 2000 13:41:59 +1300 (NZDT)
From: "Richard A. O'Keefe" <ok@atlas.otago.ac.nz>
Message-Id: <200003140041.NAA18676@atlas.otago.ac.nz>
To: gencb@itu.edu.tr, prolog@swi.psy.uva.nl
Subject: Re:  Mercury???

gencb@itu.edu.tr wrote
	I have found a language called "Mercury".
	They said that this is (more) powerful than Prolog,
	and it is faster than Prolog.
	I wish you (would) tell me your thoughts about it.

Mercury is a pure logic programming language whose syntax is extremely
close to Prolog's (indeed, until they had the Mercury compiler fully
operational, the Mercury compiler was compiled by the NU Prolog compiler).
It adds Mycroft/O'Keefe types (including higher-order types) and also
strong mode declarations.  There is also a sublanguage with functional
syntax, so you can treat it as a functional programming language if you
wish.  There is a growing library, including GUI interface and a CORBA
interface.  The documentation could be better, but then, so could SWI
Prolog's.  The module system is reasonable.

Zoltan Somogyi, who invented it, wanted a logic programming language
that could be offered to a software engineer with a straight face.
The type and mode system do have the effect of letting the compiler
generate very efficient code (e.g. toy programs running faster than
normal C, and realistic programs running within a factor of 2 of C),
but they are mainly there to let the compiler detect errors.

When you offer Mercury to a software engineer, you are not lying about
the "good quality code" or the "readability" or the "compile time error
detection" or any of those things.  You are ALSO not lying about
"100% pure declarative logic programming".  The Mercury I/O model is
that a program is a relation between the initial state of the world and
the final state of the world, although this is largely hidden by the use
of DCG notation.  (It's rather like Clean.  Like Clean, the semantics
gets rather subtle when you allow other processes to execute at the same
time, but the model does still work.)

The method chosen to permit declarative I/O also permits (as in Clean)
constant-time updatable arrays and some compile-time garbage collection.

However, there are some things that Prolog can do easily that Mercury
can't, such as modifying the database and other "reflective" stuff.

People who like typeful languages will find Mercury the logic programming
language they've been waiting for.

