Path: utzoo!attcan!uunet!aplcen!samsung!rex!ames!sun-barr!ccut!s.u-tokyo!rkna50!nttlab!icot32!icot21!chik From: chik@icot.or.jp (Chikayama Takashi) Newsgroups: comp.lang.prolog Subject: Re: Prolog's Pitfalls? Message-ID: Date: 2 Jul 90 09:38:46 GMT References: <1990Jun18.221058.11331@chaos.cs.brandeis.edu> Sender: chik@icot32.icot.or.jp Reply-To: chikayama@icot.or.jp Distribution: comp.lang.prolog Organization: Institute for New Generation Computer Technology, Tokyo, Japan. Lines: 32 In-reply-to: dsmith@chaos.cs.brandeis.edu's message of 18 Jun 90 22:10:58 GMT Although I see much debate on the "purity" problem/non-problem of logic programming language, I think one important aspect is missing in the discussion. In article <1990Jun18.221058.11331@chaos.cs.brandeis.edu> dsmith@chaos.cs.brandeis.edu (Donald A. Smith) writes: > 5. Because of its single-assignment property, Prolog uses lots of memory. > In C we can write an in-place quicksort. In any Prolog I know of, the > input list would be copied. (Has anyone figured out how to make quicksort > in-place in Prolog? Is there a workable implementation of declarative > vectors?) The worst thing about single-assignment property of Prolog is _not_ that it consumes up lots of memory. Garbage collection, at most, takes time proportional to the time required to pile the garbage. A more serious problem is that random access memory that computer hardware provides (or, at least, tries to do so) is not available from the programming language level. This means that certain algorithms, including dynamically updated hash tables, cannot be expressed in standard Prolog with the same computational complexity. This, however, can be solved by certain implementation technique without disturbing the single-assignment semantics. See, for example: author = "L. H. Eriksson and M. Rayner", title = "Incorporating Mutable Arrays into Logic Programming", booktitle = "Proceedings of the Second International Conference on Logic Programming", pages = "76--82", year = "1984" Takashi Chikayama