Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!gatech!hao!noao!arizona!debray From: debray@arizona.UUCP Newsgroups: comp.edu,comp.lang.misc Subject: Declarative languages, efficiency [was:Re: Teaching Assembler] Message-ID: <1753@megaron.arizona.edu> Date: Fri, 5-Jun-87 11:16:14 EDT Article-I.D.: megaron.1753 Posted: Fri Jun 5 11:16:14 1987 Date-Received: Sat, 6-Jun-87 20:07:47 EDT References: <7401@boring.cwi.nl> <2046@a.cs.okstate.edu> <4625@utah-cs.UUCP> Organization: U of Arizona CS Dept, Tucson Lines: 38 Xref: utgpu comp.edu:380 comp.lang.misc:422 Summary: declarative lang. implementations CAN be efficient In article <4625@utah-cs.UUCP>, shebs@utah-cs.UUCP (Stanley Shebs) writes: > [referring to slow implementations of declarative languages] I think the > students don't have any trouble drawing conclusions from the side-by-side > comparison of elegant/useless with fast/useful... > > Of course, this isn't inherent in declarative languages, it's more that > the surrounding culture offers no rewards for implementors doing mundane > things like putting in the ability to call curses or X, and compiling > to efficient native code. Too bad... Part of the problem is that the declarative language implementations a lot of people see are old and hardly representative of the state of the art. E.g. most people's experiences of Prolog are limited to C-Prolog or UNSW Prolog, which are both interpretive and hence can't really compete in terms of speed. Recently announced Prolog systems include one from Belgium that's claimed to do 200,000 LIPS on a Sun-3/200, and a system by Mike Newton of Caltech that gets over 900,000 LIPS on an IBM 3090 ("LIPS" -- "Logical Inferences per Second" -- is a measure commonly used to benchmark Prolog systems. C-Prolog does about 1500 LIPS on a Sun-3). Such systems look like they'd be competitive with current implementations of procedural languages, but of course they typically cost big bucks, so students don't see them, and the old, outdated biases live on. (I don't know much about the speeds of the latest Lisp systems: got any numbers, Stan?) The other complaint I've heard about languages like Lisp and Prolog is that they use gobs of memory, and spend a lot of time collecting garbage. But even that isn't entirely valid any more, since recent work by Paul Hudak (for applicative languages) and Maurice Bruynooghe (for logic languages) shows that a smart compiler can replace a lot of data structure copying by code with destructive assignment, and drastically reduce the amount of garbage generated. -- Saumya Debray CS Department, University of Arizona, Tucson internet: debray@arizona.edu uucp: {allegra, cmcl2, ihnp4} !arizona!debray