[mercury-users] An opinion about Mercury

Raphael Collet rco at missioncriticalit.com
Tue Feb 3 20:17:54 AEDT 2009


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.


Cheers,
Raph
--------------------------------------------------------------------------
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