
what is the best choice between SWI and GNU prolog ?
Quote:
>Brest, le lundi 19 novembre
>Hi, what is the best choice for a free prolog interpreter/compiler
>for linux ? I don't want to develop projects, but I often write
>a C or Caml program that writes huges Prolog files (1Mo) in order to solve
>a particular problem. Once the answer has been found, I don't need any longer
>the prolog file. My priority is then to find quickly the answer
>(therefore I'd like rather a slow compiler with a much quicker answer than
>a quite quick interpreter). I have SWI, but I read that GNU could compile
>into native code. What are the main points of interest in both products ?
The best solution is to try them both. If you write nice ISO code
(from what you sketch, there isn't much interaction, so this might be
feasible) both should be able to parse it. Prolog performance doesn't
stop with native code or using a virtual machine. Indexing, speed of
built-in (assert/retract, findall, term-manipulation, etc.) may well
be more important to your problem. I've seen comparisons of SWI-Prolog
with various other implementations and it is quite normal that system X
executes program A 10 times faster, but program B 10 times slower.
If performance becomes an issue, use the profiler to spot problems and
read `The Craft of Prolog' by Richard O'Keefe. Well designed
datastructures and proper use of indexing makes a *huge* difference!
For fast program loading (if this is an issue), compile it using
pl -o myexe -c mysrc.pl
Regards --- Jan