[m-users.] What's special about Mercury?

Peter Wang novalazy at gmail.com
Sun Jun 23 13:08:50 AEST 2019


On Thu, 20 Jun 2019 20:26:57 -0500, jfondren at minimaltype.com wrote:
> 
> That's what cool about Mercury. This is why I think you should
> consider using Mercury instead of some other language. In Mercury you
> make machines that can run forwards and backwards and sideways. In
> other languages you hold relationships in your head and then encode
> behaviors that apply those relationships. If you wrote a bunch of
> Feet/Inches converting functions, you might put the relationship
> between Feet and Inches in a comment. In Mercury you just write the
> relationships down--the comment is your code, and you can use it
> repeatedly to get all the separate behaviors you wanted.

I would not push the multiple modes angle at all. If a reader tries to
write even the feet to inches conversion as a multi-moded predicate,
they would quickly find it doesn't work.

(Multiple modes are still necessary to allow "unique" and "non-unique"
versions of (higher-order) predicates since a predicate cannot be
polymorphic over uniqueness.)

Peter


More information about the users mailing list