DEV Community

vindarel
vindarel

Posted on

4 1 1

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/

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more