[net.lang.prolog] Prolog vs. Pascal

Laws%SRI-AI@sri-unix.UUCP (04/09/84)

From:  Ken Laws <Laws@SRI-AI>

The latest issue of IEEE Graphics (March '84) has an article
comparing interpreted Prolog with compiled Pascal for a graphics
application.  The results are surprising to me.

J.C. Gonzalez, M.H. Williams, and I.E. Aitchison of Heriot-Watt
University report on the comparison in "Evaluation of the
Effectiveness of Prolog for a CAD Application."  They
implemented a very simple set of graphical routines: much of
the code is given in the article.  They were building a 2-D
entry and editing system where the polygons were stored as lists
of vertices and edges.  The user could enter new points and
edit previously entered figures.  This formed the front end
to a system for constructing 3-D models from orthogonal 2-D
orthographic projections (engineering drawings).  Much of the
code has the flavor of "For each line (or point or figure)
satisfying given constraints, do the following ..."  (Often only
one entity would satisfy the constraints.)

The authors report that the Prolog version (using assert and
retract to manipulate the database) was more concise, more readable,
and clearer than the Pascal version.  The Prolog version also took
less storage, was developed more quickly, and was developed with
minimum error.  What is more remarkable is that the interpreted
Prolog ran about 25% faster than the compiled Pascal.

They were using a PDP-11/34 with the NU7 Prolog interpreter
from Edinburgh and the VU Pascal compiler from Vrije University.