Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!MathWorks.Com!yeshua.marcam.com!charnel.ecst.csuchico.edu!csusac!csus.edu!netcom.com!hbaker
From: hbaker@netcom.com (Henry G. Baker)
Subject: Re: Squeezing more speed out of LISP.
Message-ID: <hbakerCxsF8n.274@netcom.com>
Organization: nil
References: <HJSTEIN.94Oct16172905@sunset.huji.ac.il>
Date: Sun, 16 Oct 1994 22:45:59 GMT
Lines: 31

In article <HJSTEIN.94Oct16172905@sunset.huji.ac.il> hjstein@sunset.huji.ac.il (Harvey J. Stein) writes:
>
>I've heard it said that maclisp used to produce numeric code as good
>as an optimizing FORTRAN compiler.  To what extent can LISPs do this
>today?  Which LISPs are best at it?  Which are worst?  What types of
>computations get closest to optimized FORTRAN speed, & which are
>slowest in comparison?  How do the freely available LISPs compare?
>What about the freely available SCHEMEs?  Does the fastest free SCHEME
>do better or worse than the fastest free LISP?  What does the user
>need to know to produce optimal code?  Are there afew simple rules of
>thumb, or many complex factors involved?

It would be very unlikely for today's Lisp compilers to produce code
as efficient as today's Fortran compilers.  For one thing, the arrays
would have to be statically allocated and have constant dimensions.
For another thing, the array indices would have to be declared in such
a way to map directly to the HW arithmetic.  The interfaces to most of
the math libraries would have to be changed to be more amenable to
static analysis.  The compiler would have to specially recognize that
the Lisp programmer didn't inadvertently take advantage of certain
control constructs in peculiar ways.  Etc., etc.

Rather than re-invent all of the clever Fortranish optimizations, it
would be far simpler and more productive to recognize and compile
certain functions into Fortran (perhaps even dynamically) and have the
Fortran compiler do its thing.  Of course, there are some hard issues
regarding interfacing Lisp to Fortran code......

      Henry Baker
      Read ftp.netcom.com:/pub/hbaker/README for info on ftp-able papers.

