Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mit-eddie.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!barmar From: barmar@mit-eddie.UUCP (Barry Margolin) Newsgroups: net.lang,net.lang.lisp Subject: Re: Using LISP for scientific programming? (gasp!) Message-ID: <86@mit-eddie.UUCP> Date: Tue, 15-Oct-85 00:48:21 EDT Article-I.D.: mit-eddi.86 Posted: Tue Oct 15 00:48:21 1985 Date-Received: Wed, 16-Oct-85 05:29:00 EDT References: <1057@sdcsvax.UUCP> <1418@umcp-cs.UUCP> <1071@sdcsvax.UUCP> <3785@garfield.UUCP> Reply-To: barmar@mit-eddie.UUCP (Barry Margolin) Distribution: net Organization: MIT, Cambridge, MA Lines: 32 Xref: watmath net.lang:1849 net.lang.lisp:576 In article <3785@garfield.UUCP> greg@hwcs.UUCP (Greg Michaelson) writes: >LISP is slow because its memory model is non-linear and dynamic. FORTRAN >has linear, static memory which corresponds 100% to VonN architecture. >Most speed loss in LISP implementations, compiled or interpreted, is due to >dynamic memory allocation and garbage collection. I am a Lisp fan, but I mostly agree. Lisp is inherently slow for some things because some of its primitives are inherently expensive. However, numeric, Fortranish applications often do not require much list allocation. And many Lisp implementations represent fixnum and flonum objects as immediate data, rather than as objects allocated in the heap. In these implementations, numeric applications will do mostly stack allocations, not consing. PDP-10 Maclisp, the one whose compiled code was rated as good as Fortran, has special fixnum and flonum stacks which are used for this optimization. Numeric arrays are also very efficient in most production Lisp implementations, especially if the arrays are only allocated at the beginning of the run (as in Fortran, not coincidentally). The test which produced this comparison presumably consisted of a Fortran program translated into Lisp, so it seems likely that it didn't do much expensive consing. My point is that both the inherent efficiency of a language (if this is even a reasonable thing to discuss) and the efficiency of an implementation depend heavily on the types of programs written using it. Lisp programs are often slow because Lisp promotes a type of programming that requires the use of dynamic memory allocation and garbage collection. -- Barry Margolin ARPA: barmar@MIT-Multics UUCP: ..!genrad!mit-eddie!barmar