Ask YC: Lisp Compiler
I know Lisp is interpreted (and this is one of its greatest advantages with its eval loop and all it brings), but is there any tool to compile Lisp code? Or to translate it into C++ code to be compiled with a C++ compiler?
(
12 comments
| 12 points
| on HN
)
If you're interested in scheme, bigloo is an option; there are surely others.
While we're on that subject, take a look at "How to make Lisp go faster than C" (http://www.lrde.epita.fr/~didier/research/verna.06.imecs.pdf)
Chicken Scheme (my favorite) is 'just' an efficient Scheme-to-C compiler, with some optimizations for the "interpreter".
Also, there's Stalin, which is one of the most powerful compilers around, in any language. Wikipedia claims that it usually outperforms hand-coded C (which isn't that hard, since C does arrays with pointers and nothing else), sometimes by a lot.
There's also Bigloo (which is French and unknown to me), and Gambit, and a whole bunch of Scheme-to-Java compilers as well.
Also, I know Scheme48 and PLT Scheme both have compilers, but I don't know much about them. Chicken is so much more hackable.
http://callcc.org
http://en.wikipedia.org/wiki/Category:Scheme_compilers has a list of Scheme compilers, if you're into that side of things.
Clojure is oriented towards functional style programming and concurrency.
Compiled code uses some reflection under the covers, but most of this can be eliminated by type hinting, which gets you into the ball park with Java.