[mercury-users] SICStus vs Mercury

Mattias Waldau mattias.waldau at abc.se
Thu Sep 21 04:56:11 AEDT 2000


I really like to program Mercury, the typing and especially the mode make
the programs work the first time they compile (but that might take a while
:-). My biggest problem was that I had to build all structures bottom-up,
something I isn't used to in Prolog.

I selected to test Mercury by implementing a simple genetic program,
currently it sorts an array. The program can be found at the links below.
I selected this problem, since the program was deterministic and very moded.
It is a perfect candidate for Mercury.

After I got the Mercury-program up and running, I transcribed it into
SICStus. This process followed the normal Prolog-development process,
run-and get fail, step down through the relevant functions to realize what I
forgot to change. There, I really missed the type and modechecking.

Mercury is about 3 times faster than SICStus on this problem. I expected
more since the program is completely deterministic. Maybe one of the
developers of Mercury or HAL should include this program into their test
suite and try to understand why the difference isn't bigger.

http://www.abc.se/~m10217/download/genetic_test.pl

http://www.abc.se/~m10217/download/genetic_test.m

Thanks for a nice programming language.

/mattias

P.s. I use SICStus 3.8.4 on Win32, no native compiler.

P.P.s. Comments on how to make the Mercury-programs better is appreciated.
However, note that the SICStus-program is far from optimal, and it can also
be improved.






--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list