Lisp as a tool for the mind
- From: Rainer Joswig <joswig@xxxxxxx>
- Date: Sun, 14 Sep 2008 18:07:44 +0200
In article <6j4pvdF1f6h2U1@xxxxxxxxxxxxxxxxxx>,
Tamas K Papp <tkpapp@xxxxxxxxx> wrote:
On Sun, 14 Sep 2008 14:47:46 +0200, John Thingstad wrote:
PÃ¥ Sun, 14 Sep 2008 14:09:05 +0200, skrev Jon Harrop
<jon@xxxxxxxxxxxxxxxxx>:
mayson wrote:This is not entirely untrue. Like Fortran and unlike C it can use size
Tamas K Papp wrote:...
God, you're a pompous ass!
"Lisp is as fast as Fortran for scientific computing" claims economics
student:
http://www.amazon.com/gp/pdp/profile/AO5ZHGQYTI4NE
His published software includes a sparse matrix library written in Lisp
using a hash table based representation:
http://www.princeton.edu/~tpapp/index.html
Given the context, I think my response was remarkably polite. Now, how
should I reply to his incorrect statements about the business policies
of companies with regard to research?
declaration to optimize floating point operations to allow several low
precision computations to run in parallel. Of course you need a compiler
that was optimized for numerical computing to get good results. CMUCL
was originally designed for numerical computing and so is the SBCL
branch. These compilers are better at type inference than the others.
Though getting the same performance as Fortran is a bit of a stretch
except perhaps for a few short examples.
Hi John and others,
I am not going to argue with JH, for one thing, I have long ago killfiled
him so I no longer see his comments. And that is a good thing, as he has
a (not-so-well) hidden agenda and is apt to distort the statements of
others, or deviate from the topic if he think this is in his interest.
For example, he quotes me as saying "Lisp is as fast as Fortran for
scientific computing", and the quotation marks imply that it is a
verbatim quote. But I never said that, what I said is "the speed of
modern CL implementations is in the same league as C and Fortran".
Distorting someone's statements and then arguing with them is not
something that should be taken seriously.
Anyhow, to clarify my statement: in the kind of scientific computing I
do, I write code to solve economic models numerically. A lot of time is
spent developing and tweaking the code. First, I usually solve a
simplified version of my model, then if the results are interesting, I
think of extensions, and solve them too. If some result looks
interesting, I try to figure out where it is coming from.
I think it is a good sign that it works for you. (Common) Lisp had been
designed for exploratory (mostly AI) programming (there
were other design goals, too). Thus it acts as a
'tool for the mind' (not my words, but I think it fits here - Hi Ernst!).
The ability to quickly code algorithms and explore various versions
with data, the ability to extend the language into the problem
domain and the interactive nature of the implementations make
this possible. You are exactly describing this experience.
My guess would be that for every hour spent running the code, I devote
5-20 hours to programming. This is where Lisp has a spectacular
advantage to C or Fortran. I can build up a quick and dirty version of
my algorithm, then modify it on the fly. If a numerical solver does not
converge because the objective function is nasty (eg not smoothly
differentiable), I can step into a debugger and explore it. I can even
automate this process with advanced condition handling of Lisp: for
example, if I find that Powell's minpack (which I packaged as cl-minpack,
fast but not too robust) does not converge, I signal a condition, and let
Nelder-Mead (more robust, slow, does not use derivatives) take over from
there. I could cite countless other examples.
Numerical solutions are not crisp and clean, sometimes they get downright
messy. The important thing is to organize computation well, and have
good debugging facilities if something goes wrong. Lisp does a superb
job in both respects.
Now what about runtime speed? Runtime speed is important, of course.
What I find is that the big divide is between 'interpreted' and
'compiled' languages: the former are slow, the second are fast. Of
course there are differences within groups, but they don't matter that
much. Would it be nice if my programs ran, say, twice as fast? Yes.
Would I switch to Fortran or C for that? Hell, no, I would spend ages
writing and debugging code, and I would hate it, because I know I would
be doing things manually that I could automate in Lisp. I switched to CL
from R (which is a nice, friendly but interpreted language), mainly for
reasons of speed (I found out about macros and condition handling later).
I find that those who care about differences in speed that are below a
factor of 2 (or even 5) are missing the point. If you want speed and
care about nothing else, you would code in assembly, that is the
"fastest" by definition. For some projects, that is the way to go, but
not for most -- programmer time is far more valuable, and correctness of
results (which comes from debugging and testing) is invaluable.
Also, these days I find that I don't even optimize my Lisp code, if it is
fast enough. And with SBCL, it is, so why would I care?
Sorry for the long post :-)
Best,
Tamas
--
http://lispm.dyndns.org/
.
- Follow-Ups:
- Re: Lisp as a tool for the mind
- From: Kenny
- Re: Lisp as a tool for the mind
- References:
- Re: What do you LISPers think of Haskell?
- From: mayson
- Re: What do you LISPers think of Haskell?
- From: Jon Harrop
- Re: What do you LISPers think of Haskell?
- From: John Thingstad
- Re: What do you LISPers think of Haskell?
- From: Tamas K Papp
- Re: What do you LISPers think of Haskell?
- Prev by Date: Re: accumulating with loop
- Next by Date: Re: A Proper Lexer
- Previous by thread: Re: What do you LISPers think of Haskell?
- Next by thread: Re: Lisp as a tool for the mind
- Index(es):
Relevant Pages
|