Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rutgers!deejay!gear!cadlab!staff From: staff@cadlab.sublink.ORG (Alex Martelli) Newsgroups: comp.lang.scheme Subject: Re: LISP vs LISP->C performance Message-ID: <258@cadlab.sublink.ORG> Date: 6 Sep 90 15:22:47 GMT References: <9008151749.AA23832@mailhost.samsung.com> <1438@anaxagoras.ils.nwu.edu> Organization: CAD.LAB, Bologna, Italia Lines: 45 krulwich@ils.nwu.edu (Bruce Krulwich) writes: >In article <9008151749.AA23832@mailhost.samsung.com>, gjc@mitech writes: >>Interesting side-note: A company called Chesnut software was at AAAI >>showing their LISP->C translator. It was interesting in that it >>produced *readable* C code. >... >>The disturbing thing was that it seemed to give BETTER performance >>than native lisp implementations from the other 3rd-party lisp vendors. >>Tells you something about the state of the art of lisp implementation >>if such a crude but effective hack as idiomatic LISP->C can do better. >I too saw this product and was intrigued. I asked the vendor (who actually >seemed to know the technical aspects of the system) why he got a speedup >over most LISP's, and his thought was that it was because most LISP systems >are written in a system-independant way, while most systems have a C >compiler that is heavily optimized in system-specific ways. In other words, >more work has gone into making sure the C compiler uses all the fastest >machine operations whenever possible, while LISP compiler writers have >presumably worried about other things like run-time environment and >portability. I am NOT, repeat, NOT surprised at all: indeed I have measured the SAME thing with, of all languages, FORTRAN!!! I have a Fortran program that does 2d fft's on 256x256 complex arrays; running it through the free f2c converter from ATT, and compiling the resulting C, gave me TWICE the performance than just compiling the Fortran source!!! That was on a Sparcstation with the penultimate generation of Sun compilers (i.e., NOT the "Sparcompilers"). It seems to boil down to: the groups doing C compilers (on workstations, at least) are MUCH better at optimizers than all other compiler writers (if it holds for two such languages as LISP and Fortran, it should hold all 'round, shouldn't it now...?-). I have sent the sources to several people who wanted to check, if you want them too just send me E-mail (I don't regularly follow this group). Others have gotten very similar results, though, on (I imagine) completely different programs. Further discussion, if any, to comp.compilers, I guess? -- Alex Martelli - CAD.LAB s.p.a., v. Stalingrado 45, Bologna, Italia Email: (work:) staff@cadlab.sublink.org, (home:) alex@am.sublink.org Phone: (work:) ++39 (51) 371099, (home:) ++39 (51) 250434; Fax: ++39 (51) 366964 (work only; any time of day or night).