Subj : Re: Compiler and an interpreter To : comp.programming From : Jon Harrop Date : Mon Aug 08 2005 07:10 pm Paul Dietz wrote: > Rob Thorpe wrote: >> Jon Harrop wrote: >>>Incidentally, someone has written a Lisp implementation that is 500x >>>slower than the OCaml and almost twice as long. :-) >> >> >> Really, I'm not surprised it's slower, but I'm surprised it's longer. > > I'm surprised it's that much slower (or, indeed, slower at all). It must > be using a different algorithm. And maybe he forgot to compile it? No, same algorithm. The difference was a slow Lisp implementation. IIRC, nothing was specialised by the compiler and the program was only compiled to interpreted byte-code, not to native-code. I was still surprised to see such a huge difference though. Scheme people are currently developing a new port of my ray tracer on comp.lang.scheme. The program is 2-3x as long as the OCaml but is now as fast as the first OCaml version on our site. Note that it took a compiler writer (one of the authors of Stalin) to optimise the Scheme though. :-) Also, and I'm not sure about this, it seems that optimising a lisp/scheme program is very compiler-dependent. -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com .