Why I Chose Common Lisp

blog.djhaskin.com

322 points by djha-skin 20 hours ago


agentkilo - 17 hours ago

SBCL is a great choice! It's a surprisingly dynamic system (so are other CL implementations).

A while ago, I did some private work for someone, using SBCL, and sent her the native binary I built, then forgot about the whole thing.

The client came back with some new requirements much later, when the project was concluded, and the source code was already lost by that time.

I vaguely remembered how I did things, so I spawned a REPL from the old binary, went into the relevant CL package, wrote a new function that overrides the old behavior, and the client's problem was solved.

I did all those without the original source code. It was a small thing to fix, but I can't imagine making the same fix so swiftly with any other tech stack, when the source code is lost. I was deeply impressed.

gigatexal - 6 minutes ago

Oh man — this has come the closest to getting me to want to really learn lisp — especially because the author is an avid fan of vim

jwr - 15 hours ago

That is a very interesting journey — mine was exactly opposite, after many years with Common Lisp, I moved to Clojure and wouldn't even think of going back. I find it intriguing that the author would want to move in the other direction, especially as concurrency was mentioned (one of the main reasons why I initially looked at Clojure).

I wonder what it was about babashka that didn't work for the author. When I need a quick script with batteries included, I use babashka and it works great.

nomilk - 17 hours ago

Looks like vim-slime is essential to how you work with CL + vim. I've only used vim for not even 2 years, and came across vim-slime 6 months ago when working in ruby and wanting to quickly 'send' code from editor (neovim) to rails console. 2 months ago I launched a startup and for hours every day had to swat/fix repercussions of bugs that weren't apparent pre-launch (as well as doing via the console things users needed but weren't able to do because the feature to do it hadn't been built yet). It was daunting. I don't know how I'd have managed without vim + vim-slime. Probably a lot of copy/pasting from vscode. Vim + vim-slime was at least a 2x productivity improvement, and >2x increase in developer happiness.

Another huge benefit of vim and vim-slime is it is immediately valuable when you use/learn any new language. So long as the language has a REPL/console/interpreter that can be opened from the terminal or terminal emulator in any form (e.g. CL, ruby, python, bash etc etc etc) then vim + vim-slime will be a brilliant ~IDE. (Possibly the only thing I haven't been able to do but wanted to is 'send' code from neovim to the javascript console in chrome, which would be pretty awesome!)

A side note: I found doom-emacs very similar to vim, only needed ~10 or so new keyboard shortcuts to be productive in emacs. (I still much prefer vim, but I'm not so down on emacs).

Naru41 - 12 hours ago

More than decade ago, I didn't understand an actual value of Lisp, but I remember this song well.

https://www.youtube.com/watch?v=HM1Zb3xmvMc

aidenn0 - 7 hours ago

As a counterpoint to author's use of vim-slime (not to say I don't believe author's commet of "I'm Okay, I Promise," but rather to communicate to others who are facing a similar choice:

I am a lifelong vim user (since elementary school in the early '90s), and I developed common lisp using vim for over a decade. I still use vim for nearly everything, but emacs as my Lisp IDE. Before evil-mode, I used the mouse and menus for 90% of what I did, and it was still an improvement over the best vim had to offer at the time (vim-slime existed back then, but would crash or hang regularly).

Author's vim setup is fairly good, but Emacs/slime is still better. They stopped using emacs because of RSI, but their vim setup defaults to "v a ( C-c C-c" to accomplish something that is "C-c C-c" in emacs/slime. They have altered it to be "v a ( <space> g" which begs the question of "why not remap keys in emacs?"

bigpeopleareold - 7 hours ago

I am looking at CL myself, but my needs are more hobby than anything, but I want to convince myself I can find it useful for my own work in certain things (e.g. I want to maybe use Bike to run C# code in an SBCL REPL.)

The feedback loop one gets with it is insanely fast, even faster than Python (certainly there are exceptions even with Python ...) That's a blessing and curse for me - the tighter a feedback loop, the harder for me to get out of a problem I am stuck on. :) But, so far, I felt like I can write a thing and not worry about running it ... type a thing, quickly get it running it in a running REPL loop. If a mistake happens, I can fix the issue right there, instead of just a long stack trace. For what it is worth though, I have been doing this in Emacs for a long time (well, for small functions), but didn't think much of it until now.

pntripathi9417 - 17 hours ago

I have been working with Clojure for 5+ years now. For CLI applications babashka has worked quite well for us.

Would love to know more about the problems you faced.

In my experience whenever I faced such issues - it has been because I am not using it well.

For CLOS kind of things I have found https://github.com/camsaul/methodical library quite well and the performance is better than default multimethods in core clojure implementation.

chii - 17 hours ago

> spent long, hard hours banging my head against native-image and it just wasn't working out.

it would be nice to know what exactly isn't working out and what the problems with native-image was.

Coz i think clojure is as close to perfect, imho, as a language can go without selling out.

thih9 - 16 hours ago

Related, Janet: https://janet-lang.org/

I especially like its github readme and the FAQ there, provides a good amount of context about the project: https://github.com/janet-lang/janet

BreakMaker9000 - 17 hours ago

Wondering whether a dialect like Jank [1] may be worth a shot?

[1] https://jank-lang.org/

stevebmark - 17 hours ago

I don't understand the "Requirements Met" section, that reasoning applies to almost any programming language. You chose Common Lisp because there's a JSON library?

quibono - 13 hours ago

The author says they went about learning CL the wrong way. I wonder if there is a standard "community approved" way of learning the language?

brabel - 16 hours ago

> I wrote this blog post because I noticed that there have been more newcomers on the Common Lisp Discord

Even CL people are using Discord now? People really do seem to love to converge to a single place.

xiaodai - an hour ago

Cos shipping things is not a concern

neilv - 12 hours ago

Common Lisp is a great choice for many purposes. (And, if you're doing a startup, a fringe language like CL is a good way to find and attract some of the best hackers, and avoid all the Leetcode grunts.)

Just comments on the Scheme/Racket parts...

> I looked at Scheme, but that community seemed to still be fractured over the r6rs/r7rs mess.

Things were fractured before R6RS, with very little portable ecosystem code, and then R6RS didn't solve that, but AFAIK, people got back up on that horse, started over, and have been embracing R7RS.

> Also, there wasn't a big enough ecosystem to suit my liking.

There's a reasonably-sized ecosystem, but three things:

1. Unless things have changed recently, much of the good stuff is still in the package system for a particular implementation (like Racket, "https://pkgs.racket-lang.org/", or Chicken, "http://eggs.call-cc.org/5/").

2. It's nothing the size of Python or JavaScript.

3. Don't believe any claims of "batteries included"; you often have to roll your own basic packages for real-world work. (But this can actually be a blessing, even for startups that have to move fast, depending on what you have to do, and how capable you're willing to rise to be.)

> I'd already tried Racket in school and didn't like it. The runtime was a bit slow and bloated for my tastes.

Although CS professors are some the greatest friends of Scheme (having designed and made much of it), CS professors can also be the worst enemies for real world use of Scheme.

Before Racket, most people who had heard of Scheme knew it only from school, in problem set homework for the dense SICP course, or from whatever pet intro CS textbook their professor wrote. That's a good way to never want to try Scheme again. (And it got worse as many CS departments became optimized Leetcode->FAANG hiring funnels.) Then people never saw Scheme used, nor even described by, real-world programmers, for real-world things.

So Racket (PLT Scheme) comes along, and half of the handful of people thinking of Scheme as a language for real things gravitate to Racket, because they are doing some real-world things. And overall it's one of the best programming languages out there.

But still, although the Racket CS professors include some great programmers, Racket is determined by CS professors, who do PL and CSE research, and write and teach textbooks. So, Racket's use in intro CS classes seems to perpetuate the tradition of CS professors ensuring that students will never again want to touch Scheme after they get a passing grade for the class.

pjmlp - 14 hours ago

With the great tooling Common Lisp commercial systems inherit from Lisp Machine and Interlisp-D days, it is kind of sad seeing vim being the option.

Also unless we're about Allegro or LispWorks with their own additions, the Java ecosystem tends to have more choice of mature libraries, I think ASDF isn't kind of spoiled by choice as Maven Central.

But to each their own.

packetlost - 17 hours ago

I went on a similar journey a couple of years ago and ended up on Gerbil Scheme instead.

Volundr - 17 hours ago

If your looking to write CLI utilities in Clojure babashka really is awesome. It doesn't meet the author's standalone binary requirement, but it's got great startup time and comes batteries included with all sorts of helpful tools.

sundarurfriend - 16 hours ago

To the extent that Julia is a Lisp (which requires some squinting and handwaving), I wonder how it stacks up against these requirements. With my limited knowledge:

1. Standalone Executables: The biggest current obstacle right away! But I believe this (as in compilation to standalone, small executables) is coming with the next version (Julia 1.12) in an early form, so maybe stabilized and reliable within this year? There does seem to be a lot of momentum in this direction.

2. Vim Workflow: vim-slime works well to my knowledge, and the overall support (eg. treesitter, LSP, etc.) is pretty good, even if VS Code is the "main" supported editor.

3. Windows/Mac/Linux Support: mostly Tier 1 support [https://julialang.org/downloads/#supported_platforms]

4. Larger Imperative Ecosystem: FFI with both C and Python are pretty standard and commonly used.

5. Runtime Speed: Crazy fast as well

6. Multithreading: Base language support is already pretty good, and there's OhMyThreads.jl [1] and data chunking libraries and many other supporting libraries around multithreading.

7. Strong Community: I'd expect Julia and CL communities to be on the same order of magnitude? Complete assumption though, in both directions. Web presence is mostly on the Discourse [2] and Slack, and the JuliaCons are pretty well attended.

8. Ecosystem: Since package management is mentioned, I'll shout out the built-in Pkg package manager, the seamless virtual environment support, and the generally quite good versioning in the ecosystem, all of which add up to a really good experience. As for particular libraries, JSON is the only one I know the answer to: JSON3.jl is a solid, standard choice. I don't know if SQLite.jl [3] would be the recommended option for SQLite or something else, HTTP.jl does the job for HTTP requests but I believe isn't particularly fast or sophisticated, and I could believe there's a subcommunity within Julia that uses "functional data structures" but I wouldn't even know where to look. But, for the ex-Clojurian, may I present Transducers.jl [4] as worth a look?

[1] https://juliafolds2.github.io/OhMyThreads.jl/stable/ [2] https://discourse.julialang.org/ [3] https://github.com/JuliaDatabases/SQLite.jl [4] https://github.com/JuliaFolds2/Transducers.jl

- 16 hours ago
[deleted]
darthrupert - 13 hours ago

Ah, it's this time of the year when we get to fantasize about cool platforms and languages before succumbing back to python, typescript or feeding the relentless AI monster in a major cloud provider.

Horffupolde - 9 hours ago

Common Lisp is great until it isn’t.

joshlemer - 6 hours ago

Does anyone use Clojure CLR? How is the startup time for that?

oldpersonintx - 15 hours ago

[dead]

billmcneale - 17 hours ago

tl;dr: OP was using a Lisp and they were looking for a different Lisp.

Probably the only reason why anyone would ever pick Common Lisp for a new project in 2025.

linkerdoo - 15 hours ago

[flagged]

linkerdoo - 15 hours ago

[flagged]

transfire - 9 hours ago

Jank

paines - 15 hours ago

He cannot use Emacs and then goes to ... Vim ?!?! Nothing against Vim or Emacs, I love both but they had their time which is long gone. I am using Linux ans OSS technolgies since 95 and would have never imagined to advocate a MS product, but just use VS Code. It's awesome. VS Code managed to by-pass the qualitiy and amount of extensions/plugins in a fraction of time Emacs took decades.