Hacker News new | past | comments | ask | show | jobs | submit login
How to make Lisp go faster than C [pdf] (iaeng.org)
27 points by jgg on May 30, 2010 | hide | past | favorite | 15 comments



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.


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...


>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.


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).


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?


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.


Common Lisp allows you to wrap declarations around forms. Use LOCALLY for that.


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.


barely readable


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


The scribd version is pretty bad.


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


The scribd version is nearly unreadable, but the pdf is fine.


the scribd version and Gnomes epdfviewer had terrible resolution, so I assumed it was a scanned document.

Evince displays it correctly.

The scribd version seems to be terrible for everybody though


gcc 4.0.3 vs. CMUCL, the predecessor to SBCL.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: