[mercury-users] An opinion about Mercury
Jonathan Morgan
jonmmorgan at gmail.com
Tue Feb 3 23:00:03 AEDT 2009
On Tue, Feb 3, 2009 at 8:17 PM, Raphael Collet
<rco at missioncriticalit.com> wrote:
> Julien Fischer wrote:
>>
>> On Tue, 27 Jan 2009, Raphael Collet wrote:
>>
>>> The real issues I had with Mercury occurred in the more «imperative»
>>> modules of the project, like a small command-line tool for executing
>>> the program. It is only in those modules that I found Mercury less
>>> intuitive, or less adequate.
>>
>> I don't understand this point. Could you elaborate on it?
>> (I'm interested if it is something that could be "fixed", either
>> by extending the documentation, adding extra example etc ...)
>
> This is Romain's statement, but I can give my own opinion. I also learned
> Mercury recently, but contrary to Romain, I have 10 years of experience with
> declarative languages (both logic and functional).
>
> I think his point is the following: dealing with imperative features in
> Mercury requires more programmer discipline than with conventional
> languages. If you don't isolate imperative statements, you may end up
> adding I/O state variables to many predicates, which makes the program
> harder to maintain. He learned that well, by doing mistakes ;-)
>
> I am not sure there is so much to fix. Maybe the tutorial could propose a
> list like "10 sins in Mercury". One of them could be:
>
> * Use I/O in a predicate that is used by many other predicates in your
> program; all these other predicates will have to thread state variables and
> be deterministic; this will make your program harder to maintain.
In this regard, the tutorial really needs to mention trace goals. You
just don't want people going to a lot of trouble to alter their
program to allow I/O passing when all they want is a bit of tracing or
debug prints.
Jon
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to: mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions: mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the users
mailing list