Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!howland.reston.ans.net!paladin.american.edu!news.ecn.uoknor.edu!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: speed of prolog
Message-ID: <9515414.16612@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU (CS-Usenet)
Organization: Computer Science, University of Melbourne, Australia
References: <3pam2e$9jh@chuangtsu.acns.carleton.edu> <3pptgj$6do@percy.cs.bham.ac.uk> <3ps2ck$hge@hitchcock.dfki.uni-sb.de>
Date: Sat, 3 Jun 1995 04:58:21 GMT
Lines: 44

vanroy@dfki.uni-sb.de (Peter Van Roy) writes:

>It has been proven that there is *no inherent reason* why Prolog can't
>be made to run as fast as C; I think that by now this should be obvious
>to anyone who is well-informed about Prolog implementation technology
>(constructive proofs include the systems Parma and Aquarius; the latter
>is available for free and can run big programs). 

I dispute this claim.

I think there *are* reasons why Prolog can't be made to run as fast as C
with current implementation technology.  In particular, the lack of
arrays and pointers with destructive update in Prolog means that tasks
that use matrix multiplication, graph manipulation, hash tables, and so
forth are significantly faster in C.

While an efficient Prolog system such as Aquarius may be able to
equal (and perhaps in some cases exceed) C in performance for
problems that don't benefit from the use of arrays or pointers,
such tasks are pretty rare, IMHO.

As Tom Christiansen wrote in an article in comp.lang.perl
(I think the discussion was about perl vs tcl):

>>	Tell you what: go write a 100x100 matrix multiply
>>	integers in both languages and then let's talk
>>	speed, ok?

I don't think current implementation technology for Prolog
is capable of achieving the efficiency of C for tasks like this.

>Commercial tools have not yet used the latest Prolog implementation
>technology to get every last ounce of performance.  Perhaps this is
>because they don't feel the need?

That's because anyone who really cares about performance will write their
applications in some other language.  Prolog vendors don't care about
performance because their customers don't care about it.  Customers
for whom efficiency is important don't choose Prolog.  It's a vicious cycle.

-- 
Fergus Henderson
fjh@cs.mu.oz.au
http://www.cs.mu.oz.au/~fjh
