Common Lisp VS C: a testimony

RMAG news

I like testimonies. Here’s one on Lisp vs C. About execution time, speed of development, length of programs, ease of development.

I find SBCL produces highly performant code, and is even faster with a small number of well-placed type declarations. I have a Lisp vs C story: I’m a mathematician and was doing some research on the Cops and Robbers game in graph theory with a friend of mine who is a computer science professor and has worked in the past as a professional programmer. We needed some data on which graphs have winning strategies for the cops and decided to independently write code to compute them so we could vet the results against each other.

I wrote my code in Common Lisp and ran it with SBCL; he wrote his code in C.

My program was 500 lines and his was 4,000 lines. My program was faster than his and it’s no mystery why: I tried several different optimizations my friend also thought of, but didn’t implement because it would have been another 1,000 lines or so. I also find my program much more readable than his, just because of the length: even if you are 5 times as fast at reading C than Lisp, his program is still 8 times as long!

by @oantolin@mathstodon.xyz on Mastodon (https://framapiaf.org/@oantolin@mathstodon.xyz/112746475805471440)

and… that’s it o/

Please follow and like us:
Pin Share