[mercury-users] Error detection rate in Mercury vs Other Languages (esp C++ and Python)

Tomas By tomas at basun.net
Sat Dec 3 05:57:26 AEDT 2011


On Fri, December 2, 2011 19:36, Chris King wrote:
> (I know a real parser would have better error detection, but I want to
> be able to catch bugs during development, not after.)

"better" error detection??

Yours have none whatsoever.

I had this experience that you may soon have some 10-15 years ago, when
after writing a DCG-style Mercury parser for a non-trivial formalism,
and spending a week or so debugging it (incompletely), I threw it all
away, rewrote it in continuation-passing style (I believe it is called),
and debugged it in 15 minutes.

> Another example, again from my blog (though not yet posted) is a
> checkers-playing AI.  The move-generation predicate is necessarily
> nondet, since it is possible that there are no moves from a given
> state.

Just put the state in a data structure and make all the code det.

/Tomas


--------------------------------------------------------------------------
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