
How to make Lisp go faster than C [pdf] - jgg
http://www.iaeng.org/IJCS/issues_v32/issue_4/IJCS_32_4_19.pdf
======
greglindahl
This is typical for papers like this: take a toy algorithm, show it's kinda as
fast as C/Fortran if you do something really odd, then declare victory. This
works better if your C compiler lacks important optimizations, like a loop
nest optimizer.

If you really want to impress people, take a significant algorithm, preferably
one of the SPECcpu benchmarks, write the whole thing in Lisp, and then see
what happens.

~~~
nearestneighbor
It's not just Lisp. Language advocates are the snake oil salesmen among
computer scientists. Case in point:
[http://www.reddit.com/r/programming/comments/bnnoh/fast_auto...](http://www.reddit.com/r/programming/comments/bnnoh/fast_automatically_parallel_arrays_for_haskell/c0npq4j)

~~~
jgg
>It's not just Lisp. Language advocates are the snake oil salesmen among
computer scientists.

It's true. (-: I submitted the paper mostly because it's a condensed "how-to"
for optimizing Common Lisp code. I think the name of the paper itself is
really, really sketchy.

------
j_baker
I admit to not having read the paper all the way through, but Figure 2 only
shows Common Lisp as being noticeably faster than C in one instance, and I
suspect that's due to an anomaly of some kind (it's totally out of line with
the other C speeds).

------
Avshalom
To those who know the SBCL compiler better:

The paper says that to get the speed they had to turn off run time type
checking, but they say "here's how to do it globally" does that mean you can
turn of type checking in just one module or function?

~~~
martincmartin
Yes. The Common Lisp spec says you can put declarations a lot of places,
including prog:

<http://clhs.lisp.se/Body/s_declar.htm>

So you can basically wrap it around any S-expression you want.

When I was at ITA we did that a lot. For example, there was a macro i+ that
would expand to basically "the two arguments are fixnums, as is the result.
Now, please give me the sum."

In debug builds, the type declarations would be come assertions. In release
builds, they'd become assumptions, i.e. the whole thing would compile to a
single x64 ADD instruction.

------
swolchok
Why is the scribd version 1) ugly and 2) in Flash? I thought they were all
HTML 5 these days, and I'd clicked the scribd link to give them another
chance.

------
VMG
barely readable

~~~
jgg
What do you mean? Is it the layout, the content or something else? I was able
to read it just fine.

~~~
j_baker
The scribd version is pretty bad.

~~~
jgg
Ah, you're right, that is bad. I had only looked at the raw PDF.

------
martincmartin
gcc 4.0.3 vs. CMUCL, the predecessor to SBCL.

