Dear Ciao users,
I am forwarding to the list a couple of messages which address matters we believe are of general interest.
Antonio Costa Pereira <costa(a)ufu.br> worte:
I am not an expert programmer. Therefore, I may be doing something very stupid. Please, be patient with me. I am a linguist, with special interest in Ancient Greek and Egyptian Hieroglyphics. I usually write my programs in Visual Prolog or Mercury, but I decided to take a look in other versions of Prolog. Therefore, I downloaded Gnuprolog and Ciao Prolog. I found out that Ciao Prolog runs so slowly in my machine that it is almost useless. Depending on the problem, it is from 40 times to 200 times slower than Mercury. A typical syntax analysis of a text with five pages in Hieroglyphics takes 5 minutes in Mercury, and almost four hours in Ciao Prolog in a 5 MHz Pentium! I checked the compiler options carefully to see whether I was doing something wrong ( like missing compiler options) to no avail. Therefore, I would be glad if people from this list could help me. A friend told me that there is an option that makes Ciao Prolog generate C code that is even faster than Mercury. What is the trick to generate this C code? I have Visual C installed in my machine, that I use to compile Mercury. Is Ciao Prolog as simple to compile as Mercury? Can I use Visual C to complete the compilation? Or should I use gcc in Cygwin?
Hello. We wouldn't be surprised that Ciao Prolog goes slower than Mercury. After all, they are different languages, with Mercury requiring some more user effort, such as modes, types, determinism declarations, etc., which makes translation to C (or assembler) easier (though it is true that the latest Mercury releases do much of this job automatically --- more knowledgeable readers may want to add more information). However, the differences you mention exceed by far and large what we would expect.
Probably some declarations in the Mercury program are helping a lot the compiler, and the Prolog possible counterparts (i.e., all that can be added to an otherwise correct Prolog program in order to help a steadfast execution) are missing. From the top of my head, I can guess that maybe determinism (or, better, the lack of it) might be the culprit: some cuts properly placed, and using indexing on the first argument, might help.
How big is the program? Can it be understood after some reasonable time? If so, could you send it to me, along with some test cases? We obviously can't promise speedup, but if there is any point which can be straightforwardly improved, we may be able to spot it.
Just for curiosity, and to see if I am in the right track, how does GNU Prolog behave? Are the figures you obtain as bad as Ciao Prolog's?
Yes, it is true that we are working on compilation to C. However the compiler is still on a very preliminary stage, and although results are good, it is still far from being usable.
MCL
________________________________________________ Nula aestetica sine etica. Ergo apaga y vĂ¡monos. ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------