Home > Backend Development > C++ > body text

Common Lisp VS C: a testimony

王林
Release: 2024-07-18 11:58:27
Original
624 people have browsed it

Common Lisp VS C: a testimony

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/

The above is the detailed content of Common Lisp VS C: a testimony. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!