Newsgroups: comp.lang.prolog
Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!indetech!david
From: david@indetech.com (David Kuder)
Subject: Re: logic programs -> procedural lang?
Message-ID: <1989Sep25.182448.2441@indetech.com>
Reply-To: david@indetech.UUCP (David Kuder)
Organization: Independence Technologies, Inc. Fremont, CA
References: <27335@shemp.CS.UCLA.EDU> <869@gamera.cs.utexas.edu>
Date: Mon, 25 Sep 89 18:24:48 GMT

In article <27335@shemp.CS.UCLA.EDU> arman@oahu.cs.ucla.edu (Arman Bostani) writes:
>I am looking references to any work done in the area of "compiling"
>logic programming languages (i.e. Prolog, CLP(R), etc.) into a
>procedural/deterministic language such as C.

I know of no references to such work.  I know of at least one system that
tried to compile.  I believe that many of the commercial Prolog vendors
do compilation.  BIM is perhaps the most thorough, but I'm sure Quintus
will correct me if I'm wrong.

In article <869@gamera.cs.utexas.edu> bradley@cs.utexas.edu (Bradley L. Richards) writes:
>As far as I'm aware, little work *has* been done in this area
>(although Borland's highly successful Turbo Prolog is compiled to
>machine code).

On soapbox, I say: Turbo Prolog isn't Prolog!  They decided to compile
by stripping the guts out of unification among other things.  Don't
consider them the typical case of compiling Prolog.

>One big reason, at least with Prolog, that little work has been done
>is that you almost inevitably sacrifice one of the most important and
>distinctive features of the language when you compile it: the ability
>to have a program change its universe while running (assert/retract).

Right.  Also there are the predicates that involve running other
predicates: call, setof, etc.  Since you can build an arbitrary
predicate to be run you need to compile in the interpreter.  So you
can solve the assert/retract by simply always interpreting those
clauses.  Or you can compile the compiler into every executable.
Turns out that assert and compile aren't necessarily all that
different in some implementations.  Still even with that savings
binaries are enormous.
-- 
David A. Kuder					david@indetech.com
415 438-2003	              {sun,sharkey,pacbell}!indetech!david