|
|
|
|
|
by bawr
6239 days ago
|
|
I should know better, but I'll bite as well - were those Lisp programs, by chance, written as quick prototypes without any optimizations or by people who didn't really grok Lisp? Saying that "algorithms were the same" isn't terribly informative - after all, using the worn out factorial example, both the tail-optimized and stack-using versions of it would still use the same algorithm. |
|
I had read On Lisp and learned about macros, which I used heavily, and created a language to describe the elements of each character in macros - for instance, 'I' is typically a single vertical line.
So yes, I used some unique aspects of Lisp, and the port to C was done by basically transforming the untyped structures in the Lisp code, into C structs/datatypes. It wasn't a Greenspan law - it was just more declarations, and hand compiling I guess, which worked well in my C compiler, and better than the Lisp compilers I tried.
I hate replying so many times in a single thread, but you did ask! :-)
[Postscript] I used a good profiler which could tell me slow lines and functions. My speedups were entirely due to finding clever ways of optimising, thanks to the profiler. So that's the secret weapon...