A Road to Lisp: Which Lisp
scotto.me
scotto.me
What I like about this article is that it walks through the different "camps" of Lisp. Scheme is so intriguing to me because of how small it can actually be. I can build nearly any paradigm I want to exist. The problem is, if I were to actually go find a job where they were using a Lisp, (I hear those actually exist) they wouldn't want to use my "Result monad + match statement - railway pattern" that I've used from OCaml and Rust. So learning something that is truly "common" can make more sense.
As far as learning though, Scheme feels "just right". I've imposed a "no AI until I've found a working solution" rule that keeps my mind engaged. Couple that with a willingness to say, "I don't know that right now... I'll think about it throughout the day and maybe by this evening I'll have an answer".
Writing scripts using [0] Babashka is also really nice.
I've used it a tiny bit at work (on Windows) and at home (on Linux), and ran into one issue with "out" parameters, but otherwise it works really well.
> Common Lisp implementation on .NET. Lisp source is compiled to CIL (Common Intermediate Language) and runs on the .NET JIT — so the same Lisp image runs on Windows, macOS, and Linux across x86-64 and ARM64 without per-platform porting work.
What's that supposed to mean? Many (probably most if we only consider the non-toy ones) lisp implementations are "native" (compiling to native machine code, not interpreted).
That's a unique definition of "native". It suggests that C is not a native language, which is going to be a hard thing to convince others of.
I've already got enough of JVM compatibility to run Ring apps, and have some fun libraries like a Reagent style library on top of GTK https://yogthos.net/posts/2026-07-02-jolt.html
Now there are of course limitations to what you can do in terms of not supporting Java reflection or the full Clojure compiler. But I've made some nifty small scripts and convenience helpers with it. And the dev experience of making these scripts is so much nicer than trying to write bash scripts. The Clojure edn syntax is super simple, and the REPL connected editor let me rapidly test parts of the code just like with full Clojure apps.
I don't have experience with other lisps, but I can vouch for Clojure being very nice. The community was welcoming and friendly to newcomers when I started learning, I hope it still is. One thing I love about the Clojure ecosystem and community is the effort taken to never break libraries. I've looked at libraries I used some ten years ago, and the API is still compatible with code I wrote back then. There is very little churn. Maybe this is because the language is largely untyped and editors only partially check "types". Having breakages in libraries you consume once every couple of months would get really tiring in Clojure land. I'd imagine the same problems would present themselves in Common Lisp and others.
Codex can one shot the bindings flawlessly, and the interface is significantly faster for downcalls vs. JNI.
I had used C++ for several years to make shareware games, so I took a test to challenge some programming courses. I vaguely recall doing well, but my advisor encouraged me to take them anyway. I'm glad that I did, because I had little understanding of theory.
Funny story: the instructor never mentioned that we could use more than one line of code. So every single piece of homework that I handed in, and every test, was one giant line of nested logic. Which worked better than one might expect, and completely changed how I wrote code from that point forward. That's how I made the connection a decade later that functional programming is akin to a spreadsheet, as are higher-order method chains and immutable variables.
I think of Clojure as being a layer above Lisp, sort of like how Swift might be considered a layer above Objective-C/Smalltalk. However, bare Lisp has problems around not quite giving enough out of the box. It's minimalist enough that developers end up reinventing the wheel for things that should probably be provided by a layer/library similar to Scheme or Clojure.
To digress, I feel that mutable variables and even monads are a code smell in functional programming since they can cause impurity. They're more of a crutch to ease conversion of code from imperative languages. However, monads can be useful to simulate every path through a program, sort of like superposition in quantum mechanics and SAT solvers. So they aren't necessarily bad, just taught incorrectly, probably because they're so hard to grok.
I'd vote to settle on a series of layers like Common Lisp -> Scheme/Racket -> Clojure/Elisp, with the final layer providing the intersection of features available from the most widely-used Lisp variants. Note that this is specifically to form a bridge from imperative languages, so research work might need additional DSL features brought forth from the Racket layer.
Edit: I forgot to mention that Scheme is a good fit for genetic algorithms, see books by John Koza (no affiliation). My feeling is that we haven't seen anything yet regarding what problems AI can solve, since it's having to do it the "bare hands" way with LLMs and pattern matching.
If you want a Scheme with batteries included, I recommend GNU Guile. Also worth your time are Racket, Clojure, Janet.
It's free online: https://scheme.com/tspl4/
- https://sr.ht/~dieggsy/whisper/
- https://dieggsy.com/json-literals.html
And could also be used to build languages, supporting more modern programming paradigms (though yes, I believe Racket does make this easier):
- https://coalton-lang.github.io/
I also might have written the Common Lisp example using reduce as well, which is in the standard library, but that's preference. Nice to have the option though:
(defun calculate (instructions)
(reduce
(lambda (result op-value)
(destructuring-bind (operation value) op-value
(case operation
(:add (+ result value))
(:subtract (- result value))
(:multiply (* result value)))))
instructions
:initial-value 0))
(calculate '((:add 5) (:multiply 3) (:subtract 4))) ;; => 11 (funcall (ecase operation (:add '+) (:subtract '-) (:multiply '*)) result value)
instead, looks funkier =) [1]> (setf (symbol-function :add) (function +))
#<SYSTEM-FUNCTION +>
[2]> (setf (symbol-function :subtract) (function -))
#<SYSTEM-FUNCTION ->
[3]> (setf (symbol-function :multiply) (function *))
#<SYSTEM-FUNCTION *>
[4]> (setf (symbol-function :divide) (function /))
#<SYSTEM-FUNCTION />
[5]> (reduce (lambda (x y) (funcall (car y) x (cadr y))) '((:add 5) (:multiply 3) (:subtract 4)) :initial-value 0)
11
This is actually a small benefit of the two namespaces. Keywords can't be variables because they evaluate to themselves, but that is not relevant to the operator position that does not resolve variables.But this made me realize there's no way in CL (even with PROGV shenanigans) to temporarily bind the function value of a symbol, unlike the variable one through a simple LET =(
So this turns in this horrible (and incorrect, since this doesn't restore the previous FDEFINITIONs) thing when you want to use this hack "properly":
(defun calculate (instructions)
(setf (symbol-function :add) #'+
(symbol-function :subtract) #'-
(symbol-function :multiply) #'*)
(unwind-protect
(reduce
(lambda (result op-value)
(funcall (car op-value) result (cadr op-value)))
instructions
:initial-value 0)
(fmakunbound :add)
(fmakunbound :subtract)
(fmakunbound :multiply)))Pascal Costanza somehow implemented such a thing. See 2003 paper "Dynamically Scoped Functions as the Essence of AOP", a precursor to work on AspectL and ContextL.
https://dl.acm.org/doi/pdf/10.1145/944579.944587
Dynamically scoped functions are wrappers which indirect to lambdas bound to a special variable; i.e. this is boostrapped out of dynamic variable scope.
(defun calculate (instructions)
(let ((result 0))
(dolist (e instructions result)
(destructuring-bind (operator operand) e
(setf result
(case operator
(add (+ result operand))
(multiply (* result operand))
(subtract (- result operand))))))))
(defun calculate (instructions)
(do ((result 0))
((null instructions) result)
(destructuring-bind (operator operand) (pop instructions)
(setf result
(case operator
(add (+ result operand))
(multiply (* result operand))
(subtract (- result operand)))))))Does that exist somewhere ? I hope jank gets there. Or maybe roc will.
At this point, given the progress and expectations of using LLM, writing code is going to be purely a hobby concern, like carving wood furniture became a hobby once you have Ikea.
So we might as well use fun tools :)
What's the "cargo xxx" of lisp ? It depends. Maybe it's "quicklisp something". Maybe it's "ASDF something". Maybe it's a mixture of three different things and you ask a dumb question on SO that should be in the first page of the manual, and you get 10k views : https://emacs.stackexchange.com/questions/83200/given-a-bran...
I know, you enjoy the power of having options, configuring everything, and shaving your yaks to the bone with macros over macros.
But I suspect you never hear of so many questions about "retro antagonist polymorphic macros over monadic functional arrowd", because people give up at "how do I import a lib to make an http call" ?
- a single, standard and opinionated way to lay your frigging files on your effing disk. "cargo new". And, no, it should NOT require people to create a top level "common-lisp" folder to store all their projects.
- adding and loading deps. Sorry, typing quicklisp:xxxx in every repl session you open is not "cargo add".
- a baked in way to run some sort of unit test suite. Have dozens of options if you want, but what is the "cargo test" ?
Of course all those problems have been solved by various tools somewhere in 1997, so it will sound like an "entitled millennial" comment.
But, soon, the tagline to aim for will be "a lisp for the 100 years of lisp". What's that ?
Ironically, this is where I gave up on trying to learn Rust. I just wanted to make a HTTP request and the simplest solution was to… download a library with hundreds of dependencies taking up half a gigabyte?
> a baked in way to run some sort of unit test suite. Have dozens of options if you want, but what is the "cargo test"?
That actually is ASDF, to be more specific:
(asdf:test-system system &rest keys &key force force-not verbose version &allow-other-keys)
Although if we're honest, the real way to run a test suite in CL is to open the REPL, load your system, and just type something like (run-test-suite).I find it a little puzzling when a language ships the one build system to rule them all. I get that it saves some decision stress but it also is a monoculture. Gradle vs Maven in Java at least puts competitive pressure on each; c/c++ obviously have many options; even Haskell had/has stack vs cabal.
* [clj-coll](https://github.com/dtenny/clj-coll) - Clojure collection and sequence APIs in Common Lisp, with optional Clojure collection syntax.
* provides immutable Cons, Queue, PersistentList, capabilities as well as Vector, Set, and Map analogues built on FSet (but accessed entirely via Clojure APIs).
* optional read syntax so you can type `{:a 1 :b 2}`, `#{1 2 3}`, and `[1 2 3]`.
* [clj-con](https://github.com/dtenny/clj-con) - Clojure-style concurrency operations in Common Lisp.* [clj-re](https://github.com/dtenny/clj-re/) - Clojure-style regular expression functions.
* [clj-arrows](https://github.com/dtenny/clj-arrows) - Clojure-compatible threading/transformation/arrow macros for Common Lisp.
editor: https://coalton-lang.github.io/20260424-mine/
type system: Coalton
This would be my advice. Why? My own road was haphazard. Other books broaden your mind and teach you really cool tricks. This book gets you using lisp like you would say golang. But it still teaches you the lisp things and broadens your mind. Time spent choosing will be better spent reading this book. After that PAIP, On Lisp, SICP etc.
An Introduction to Programming in EMacs Lisp is also good for the first few chapters even if you don’t use emacs because you are given fundamental concepts of lisp that can be applied to the understanding of other dialects. It’s also free.
Learn you a Haskell (despite Haskell being not a flavor of list, they share similar DNA ) is great at understanding functional programming with lisp like languages.
It’s funny to me that it was critiqued for being “bloated” when now it looks like a focused minimal library.
Also, SBCL has some nice features specific to them, I'm sure it's the same for other implementations. So while there's a lot that's common between them all I find myself using a lot of platform specific functions.
Warning about the issues that come with ANSI CL's frozen spec (threads/sockets/unicode/extensible sequences/gray streams/etc... as extensions with a varying amount of support with compatibility layers often available to write portable-ish code, "bolted-on" CLOS never fully integrated) and its various rust spots, not just the good points.
Mention that CL has provisions for gradual typing (with limits) which are exploited by SBCL.
Scheme, obviously, along with the same warning as CL about pain of writing portable code that interacts with the OS (does it have compatibility layers like CL?) amplified by the R6RS vs unfinished R7RS-large mess.
A few words about the build system/third-party packaging situation and alternative implementations.
That helped me to think about recursion, functional programming, and type driven development. After going through HTDP I was able to breeze through complex problems that were unsolvable before.
examples?
you nailed it.
>then keep breaking the problem down into smaller functions until it is solved.
That technique definitely works. i have used it. so have tons of others.
it closely resembles the methods of structured programming and stepwise refinement.
Both those terms are probably there in Wikipedia, because they are notable, being well known. and check out niklaus wirth. ditto. turing prize winner or other major awardee. pascal. modula family languages. etc.
For instance "I'm new to Lisp, I want to try one..." is a person without a lot of background and information to make that choice. And they probably realize it and it makes them nervous about making that choice.
Both highly recommended.
While Emacs Lisp is confined to the editor, it also shows that the Editor is not that, and much has been said of it as an OS, an Application Platform, and so on.
Since about 1992, I've used it as platform for many things as well as a general purpose text editor I couldn't initially figure out how to quit.
I'm sure many here are more fervent about Emacs, living in the terminal switched to living in Emacs for a lot of folks... that's really a testament to the usability gravity of an integrated computing platform with Lisp as it's only scripting language.
ymmv of course
again.
To be specific, you can work all of the examples in Graham's On Lisp in Python except for one of the last chapters where he implements continuations that really need macros -- but this is basically the async/await facility that Python already has. The other examples use macros for performance but work fine with just plain functional programming.
React with hooks is an example of that kind of system at work -- the JSX transformation is a very simple shim you can put in front of the JS compiler and the hooks themselves are the kind of trick that On Lisp teaches you how to do.
On Lisp doesn't use the kind of tree-walking macros that really are unique to Lisp. And... the techniques in the Dragon Book for writing compilers are the real magic. If looking to Lisp as an old shiny keeps you from learning how to write compilers, it is holding you back.
I think the homoiconic thing leads people astray. There's a real tension that, for performance reasons, mainstream compilers aren't extensible, for instance you might want to write a
unless(X) {...} => if(!X) {...}
control structure in a new language and for something in Java that is really a production rule in the grammar, maybe a class to represent the unless block, and a rewriting rule that gets applied to the AST. If the compiler was designed to be easily extensible that would be less code than the POM file for the project. But it's not so it isn't.Many things hold us back.
The industry has been so traumzatized by slow compiles that trading speed for extensibility doesn't sell to the people who create languages. Also once you have the sophistication to make things like parser generators you know how to get things done with the terribly unergonomic parser generators we have and don't have a lot of empathy for all the programmers out there who might be using parser generators if any of them were built as if usability matters.
i had a phase when I was using PyPi a lot for branchy "old AI" kinds of workloads and felt it was an easy win but since then it has been either numpy or PIL or pytorch doing the heavy lifting or scripty stuff like uploading files to S3 where performance doesn't matter a lot.
I will grant that Common Lisp can be compiled to run amazingly quickly!
This is how https://github.com/marcoheisig/Petalisp#why-is-petalisp-writ... and https://github.com/numcl/specialized-function can exist.
Common Lisp, as an example, makes some deliberate flexibility (and elegance) vs. performance trade-offs. I'd think to speed Python up more than PyPy could, one would have to sacrifice some of its features (some of those might not be all that popular or even desirable).
Nah, Python has its place. If its performance isn't adequate for the problem at hand, rewrite the bottlenecks in C++ and be done. LLMs should make that easy, no?
However CPython isn't even half way there to either Papyrus or GraalPy.
The community attitude to rewrite into C, C++, Rust, Zig, whatever, is exactly why Python will never be like other dynamic languages, and the dynamism excuse will always be used.
Thankfully at least GPU vendors see it otherwise, so if nothing else at least it will get JITs that speak GPU machine code.
Which is something that can be done in CLOS, though. And in a much more thought out fashion, as usual with the CLOS/MOP, cf https://www.lispworks.com/documentation/HyperSpec/Body/04_cf...
Working with Clojure is an absolute delight. It strips down all the dogma and let's you deal with the "business logic" as if you're cooking steak using no BS ingredients - meat is meat, herbs are real, stove is hot.
Why would I ever choose bash for writing anything slightly more complex than simple redirection, when I can do things in way better fashion with babashka. Why would I wrestle a YAML CI pipeline that only fails on push, when I can drive the whole thing from a babashka task file, run each step locally in the REPL, and actually debug it?
Why would I ever deal with Lua, if I can't even format it for "readability" - no matter how I do it, it just looks darn ugly, and luafmt often makes it worse. Why, if I can just slash down dozen lines of Lua boilerplate compressing it into a three-liner Fennel macro? With Fennel, I can interactively poke through elements of my WM through Hammerspoon on Mac, and that's just bananas.
Why would I ever deal with JSON, when EDN is almost twice as compact and far more readable - I can align things and treat data as a literal table. Besides, I can group, sort, filter, slice, dice, salt & pepper that data easily, without ever leaving my trusted editor.
Why would I choose to build a web-scraper in Python, when I can use nbb driving Playwright and go through selectors interactively, directly from my editor, as if it is a devtools console. And I don't even have to restart anything, deal with state changes, etc.
How can I abandon Emacs where I can just open a scratch buffer, type some Elisp and change the behavior of my editor, my WM, my OS and even things on remote computers. No other text editing environment works the way Emacs does - nothing even comes close. It feels like playing a video game, where my controller in my editor.
Why would I write Flutter UIs in Dart, fighting the widget-tree ceremony and endless build() boilerplate, when ClojureDart lets me express the same tree as plain data and hot-reload it interactively? The layout is just nested maps and vectors.
Why would I reach for C when I need to embed a small, fast scripting layer. Text parsing alone would be a regex nightmare elsewhere.
Why would I bolt a templating engine onto HTML strings, when Hiccup makes markup just vectors - so my views compose, filter, and generate like any other data, no special templating DSL to learn
And with all sorts of different runtimes and dissimilar Lisp dialects, it still feels as if you're working with the same language. The mental overhead when switching is so negligible. While switching between just JS and TS - which are supposed to be of the "same family" - feels quite annoying. Despite the fact that I've put years into those - far longer than any Lisp I've ever used.
Sure, nothing special about Lisp at all. Except that practicing Lisp can actually make you a polyglot. You'd realize that it isn't syntax that makes a programming language, but runtime and semantics do. After years of dealing with different PLs, I lost a preference for one specific language - I'd choose the runtime best suitable for the task, and then see if I can bolt Lisp on top of it. And these days, it feels like there isn't a platform left where you can't meaningfully do things via Lisp.
As for GNU emacs I got over it. Like I was introduced to it in 1989, it was the cool new editor for the Unix world, one of my friends loved scripting with it. However I experienced it getting really janky about 20 years before other software got janky and I don't know why. Some of it might have been rot in things it depends on, like it used to be curses apps actually worked right but now they suffer data corruption from the telnet/ssh connection and always seem to have an off-by-one on the screen size. X Windows got glitchier. I guess emacs was ahead of its time, now people write janky apps with Electron -- like I have to type R E A L L Y : S L O W L Y when I use Slack at work. Photoshop is like that too, computers are 100x's of times faster so Photoshop should boot up faster than Momo Chiyoda can transform but no, it doesn't.
I switched to vim around 2003 as my emergency Unix editor because I could log into a busted system and start working and not have to rely on the package system (often the thing that was busted) to install emacs or build it from scratch. Helps that it doesn't use continuation characters so cut and past just works, there are lots of little things that make vim live more comfortably side by side with modern GUI life than emacs does.
How the heck anyone doing anything remotely related to programming can't be familiar with vim navigation? And if they're familiar what does "meh" supposed to mean? It's like having an "opinion" about where the Tab key sits on the keyboard: "I hate Tab, it was a stupid idea to put it on the left side..."
Years ago I stopped typing anything longer than three words in anything but my editor, I just don't even understand why every programmer doesn't do that - it just makes perfect sense. The idea of automating copy+paste from any program into your editor and back is such an obvious thing, it feels stupid if you're not doing that.
> there are lots of little things that make vim live more comfortably side by side with modern GUI life than emacs does.
No disrespect, but honestly it sounds like you have never experienced the practical side of a Lisp system that permeates your OS. You just can't meaningfully compare Vim (or pretty much any other text editor) and Emacs, because Emacs is not a text editor, it's rather a text orchestrator. I for example easily build such workflows like "grab the url from one of my browser tabs and insert it", or I can get it from my browser history, or "retrive current thread I see in Slack and search for specific piece of text". Or placing the cursor to the plain text like "FOO-4142" immediately gets pattern matched and I see the popup with the Jira ticket description. That all I do in the middle of typing any text, like for example this very comment. I don't have to leave my editor, I'm not forced to do things how they dictated by other apps.
I use Neovim almost daily, it comes in handy for quick text editing in the terminal, and I love the idea of Vim in general - it's a beautiful, practical, amazing model and I use it everywhere, it permeates my OS - my WM, all my editors, my terminal and my browsers. But Neovim just can't be like Emacs, because fundamentally they are categorically incomparable. In practice that means that the "comfortably side by side" reach you're trying to describe goes further, because of affordances - building specific workflows that affect things on your local and remote machines is cheaper, quicker and simpler. I would grab any area of my screen and it gets immediately OCRed and extracted text pops in an Emacs buffer. It took me fifteen minutes to build that workflow. Getting done anything similar in pretty much any other editor wouldn't even occur to me - I wouldn't even bother seeing it as a problem that needs solving. Affordances shape the way you do things: https://news.ycombinator.com/item?id=48876315
2. Having some features of Lisp is not the same thing as having those features in that form and integrated in that way.
It's not just the roster of features, but how they blend!
If two features have to speak with each other through some interpretation layer, that spoils everything.
The real thing with CL is that the entire language is available during parsing and macro expansion and that users can hook into these steps to influence them. No artificial limitations like you get in C++'s consteval, you can do everything and anything without having to use a crappy DSL to do it.
Also, I've never found SBCL slow to compile. Have you?
(2) The trouble with those balls-to-the-walls macros is that systems that use them tend to be "write only", like some guy writes 4000 lines of Lisp that do the work of 80,000 lines of C++ and then he moves on and there is never a version 2.0 but the system gets rewritten in C++, supposedly for performance, but really because they couldn't find anybody who could maintain it. It is really pleasing to see how little code is in Lisp systems from the golden age of AI but... when Yahoo! bought Graham's startup they kept the customers but threw away the code.
You are more likely to be sustainable if you get two people to write 12,000 lines in something like typescript or ML that uses Dragon Book technology to the same end.
It is true that, today, we have a vast array of impressive tools at our disposal, from parser combinators and generators, code generators to entire language workbenches with projectional editing capabilities. However, if one were to design a language for any reason, having a deep understanding of the expressiveness of computational models such as the lambda calculus would certainly be an "advantage" (especially for those who end up having to use the language): A Lisp/Scheme is as close to interactive lambda calculus as it gets. From there on, one can learn about implementing different evaluation strategies, scoping rules and continuations (William Byrd's "The Most Beautiful Program Ever Written" [2] also to mind).
Now, I am not sure whether homoiconicity tends to lead people astray. It is true that is it not strictly necessary to make a language extensible (e.g., Smalltalk has no macros and is very extensible due to its powerful meta-object protocol and an elegant syntax for closures), but it's still worth studying the concept. For example, writing a metaintpreter in Prolog [3] is surprisingly easy because of its homoiconicity.
[1] https://softwarepreservation.computerhistory.org/LISP/book/L...
That's one use. It's also used in commercial and open source systems. Guile, for instance, has been used as an extension language (like lua and others) in many projects.
Several Scheme implementations, e.g., Chicken, Chez, Gambit, are capable of producing almost any type of program. I'm most familiar with Chicken Scheme. Comes with a large "standard" library plus a broad range of available extensions. Its easy to use FFI adds to productivity.
My experience anyway. Of course, mileage varies widely among users of any language.
I just don't understand the criticism in the post I was replying to.
Can confirm; got a few hints from the 1988 edition when working on the TXR Lisp compiler.
Oh, and also when implementing regexes, not to forget!
However, the Lisp compiler has its own magics that are not exactly covered in the Dragon Book. Some really nice way of doing things.
Common Lisp can match and exceed languages like Java without the backing of a megacorp.
Carp Lisp is basically identical to C in performance and old PS games were shipped in a proprietary dialect (GOAL) and had very good performance.
Lisp has proven itself capable great performance at every abstraction level.
> The best LISP is the one you create yourself. You learn so much about programming by implementing your own language, and LISP is brilliant for this purpose thanks to its simple syntax and homoiconicity (code is data, data is code). It's also a great way to learn a new existing language, like Rust or Go, by writing a LISP interpreter with it.
(loop :do (print (eval (read))))
to implementing all of Common Lisp in RISC-V assembly: pacman -Syu sbcl emacs
M-x package-install slime RET
isn't a lot of keystrokes.I just find readability such a hurdle regardless of how long I used it. I didn't find that it ever became as natural as the other group of programming languages.
I find a procedural style of programming so much easier to reason about, both when writing and reading.
Either way, I'm really happy I took some time to learn it and use it a little at some point.
You do have to keep up with the parentheses of course, but editor settings or extensions can make this automatic if not invisible.
I do find that most of my lisp skills carry over to JavaScript quite well while allowing me to write imperative functions more fluently.
Prog blocks are pretty good. I wonder if another DSL could be better.
Then do that.
There's nothing stopping you from using pretty much any style of programming that you like. Or mix and match. Or evolve over time.
Loops, lists, arrays, structures. Simple iteration: dotimes, dolist, loop. If those are your bread and butter, then feast! CL will happily do that. That's what I do. I just don't think "functionally" when I do CL code, I'm just not there yet, so its unnatural for me, and not what comes spewing out of my fingers when I write code.
And it's "OK".
You don't have to use the other features of the language, but they're there if you want to dip your toe into it.
With CL, also, I tend to be really wordy on variable and function names. I'm really fond of kabob-case-for-identifers.
I've had the same complaints when I started. I think, realistically, every programmer who's learning Lisp after getting experience in a bunch of other languages has to deal with that. The mental overhead feels real. Yet, after a while, there's some psychological threshold - Lisp starts feeling more intuitive. At some point, there's just no turning back - nothing ever will feel again more readable than Lisp code. It's just like riding a bike. Once you "get it", there's just no way to "unget it" back.
Why prefer lisp-1 over lisp-2 or vice-versa?
Common Lisp and Racket are Lisp-2s but honestly, the namespace thing seems like a minor difference compared to all the other features that differentiate them.
(defun apply-twice (f x)
(funcall f (funcall f x)))
(apply-twice #'1+ 2)
Versus this with a lisp-1: (define (apply-twice f x)
(f (f x))
(apply-twice 1+ 2) ;; assuming 1+ is defined
But there are so many other differences between the lisps in the two categories that this probably won't be the deciding factor for most people.The classic example is, imagine you have a function with a local variable called “list”, common enough. Now imagine you invoke a macro inside that function which generates a call to the built-in “list” function - also common enough. In a Lisp-1 without hygiene that breaks - your local definition shadowed the built-in; in a Lisp-2 or hygienic Lisp-1 you’re in the clear.
Lisp 2 advocates typically make a few arguments. One is that having a separate namespace for functions makes it clearer when you are using a function vs another value. The second is that the evaluator has less work to do when examining the head of a list - it needs only look in the function environment, not the full environment.
On the first subject I must disagree - you can bind a function to a regular variable and then use that variable everywhere (except in the car of a list representing a function call), so for most positions in a set of expressions you don't really get information about whether the object being denoted is a function or not.
I suppose the second point is somewhat valid, though I suspect if you benchmarked interpreters and compilers it would barely matter. As a person who favors functional programming with a lot of combinators, I find Lisp 2 introduces a lot of pointless noise in the syntax for no reason. And I fundamentally just don't see functions as significantly different sorts of values, so I find the syntactic distinction bizarre.
(defun merge-sort (list before?)
(declare (type List list)
(type Function before?))
(flet ((merge-2 (a b)
(declare (type List a b)
(merge 'List a b before?)))
(unless (null list)
(reduce #'merge-2 list :key #'list))))
(merge-sort '(1 9 8 2 3 4 7 6 5)
#'<)
Instead of having to name lists 'lst' or something. Which is pretty much personal preference anyway. (defun first-two (list)
(assert (>= (length list)
2))
(list (first list)
(second list)))
In a language which doesn't normalise the case of symbols you could in theory work around that by capitalising or upper-casing either the function or the variable, but that's still not a particularly elegant solution.Would you want to use a weird POSIX shell in which "for x in *.jpg; ..." stopped working because you assigned "for=42"?
Yet Lisp-1 has a notational advantage for programs that work with functional values; programs that indirect upon functions are more succinct, free of "shim" operators for lifting values out of the function binding space, or requesting application of a function value.
In the TXR Lisp dialect, I worked out a way to have the notational convenience, without bringing in the Lisp-1 issue.
1. The substrate, including macro-expansion logic, is thoroughly Lisp-2.
2. When a compound form is written in square brackets, it indicates that immediate elements (those constituents that are symbols) are to be looked up in a single namespace that is a merger of the function and variable namespaces according to precisely documented rules. This is not recursively applied to the form; its arguments that are compound forms are not treated this way unless they use square brackets.
3. Macros are not affected. In a form [a b c ...], the element a is neither recognized as a special operator or as an operator macro. If it is a symbol, it is either a variable, or a symbol macro.
4. [ ... ] is a surface syntax with a straightforward representation: the (dwim ...) operator. The above semantics is thoroughly baked into the macro expander and correctly treated at all necessary levels of the language: the handling of lexical scopes at expansion time and compilation/evaluation.
This system leaves mainly just one small infelicity. The merged 1+2 namespace is not available in certain contexts when it would be handy. Like say we are writing a function that takes a functional argument, that we would like to default:
(defun my-sort (sequence : (test-fn equal)) ...) ;; nope!
There is no variable equal. We cannot do this: (defun my-sort (sequence : [test-fn equal]) ...) ;; nope!
because the (test-fn equal) syntax is not a form to be evaluated; it is just notation within the parameter list which has not been equipped with support for the alternative brackets/dwim structure. The way to do this is: (defun my-sort (sequence : (test-fn (fun equal))) ...)
fun* is like Common Lisp's function* operator. It's one of the few instances you ever have to use it, the others also being situations like values in binding constructs such as let. It is not worth complicating things to provide a way to take the fun out these situations.we can explore libraries on https://github.com/CodyReichert/awesome-cl/
concise literals: serapeum's dict or other libraries bring you { } for hash tables and the like.
persistent collections: FSet (and more)
lazy sequences: series, gtwiwtg (generators) (and more)
pattern-matching: Trivia
many libraries are shipped in CIEL: https://ciel-lang.org/ (shameless plug)
---
> It’s currently used in …
more example companies: https://github.com/azzamsa/awesome-lisp-companies/
also: https://lisp-screenshots.org/
---
> at the cost of slightly slower startup times
that means ±30ms, not the Java-esque slow startup time ;)
---
editors: don't miss https://lispcookbook.github.io/cl-cookbook/editor-support.ht... and the new Mine, OLIVE for VSCode, ICL repl (terminal and browser).
:)
Elisp::Emacs as AutoLISP::AutoCAD. AutoLISP was my first introduction to Lisp-style language. When I first started using it (1987) for macros in AutoCAD, I really had no idea what Lisp was. It was just a fun and easy way to automate AutoCAD.
Strange they did not make OpenSCAD in AutoLISP-style.
I have to read the manual all the time, because I never learn the weird syntax of OpenSCAD for-statement.
There is a very nice IDE called Mine
Motivates me to learn more about Lisp (and Clojure)
I would be happy with (neo)Vim setup as well, but that was way behind Emacs and broken when I tried.
I have not tried it, I'm an Emacs nerd.
However, price for hobby user license at 750 USD is laughable.
https://coalton-lang.github.io/20260424-mine/ and https://lem-project.github.io/
While there are many reasons to perhaps stay away from Emacs, realistically, for any serious Lisper, there's just no other alternative - sadly or otherwise.
I think, collectively, as the industry force, we software developers having now to pay imperceptible price for disregarding the pragmaticism we had/have in systems like Lisp and Smalltalk. We standardized on dead artifacts: text files compiled into opaque binaries, restarted on every change. We rebuilt weaker versions of what those systems had, piecemeal, decades later, and call them innovations.
You don't notice the cost because it's spread out. Nobody ever gets handed the bill. Instead it shows up as little bits of friction across millions of hours of work: slow feedback, extra steps, tools that treat a running program like you can't touch it. We took the accidental limits of file-based, restart-everything development and assumed that's just how programming works. And quietly, all together, we paid a huge price for giving up the live, flexible systems we already had.
Emacs is one of the last mainstream artifacts that still embodies that old ethos. For serious Lisp work the alternatives are pale because they still treat code as text to be sent elsewhere, rather than a live system you live inside. This lock-in isn't some kind of nostalgia, it's just nothing else preserves that property.
I wish there were more Emacs-like systems, instead of dozens of tools that all trying to solve same or similar problems - how many different tools are there for Python alone just to unmess its cascaded dependency woes? Or look at the whole containerization tower - Docker, Compose, k8s, Helm, Nix - all because we've "forgotten" how to reliably reconstruct a running program's state.
TLDR: Don't ignore Lisp - it's not archaic, it's not "theoretical", it's practical, it works and it works well. And once you get some serious footing with Lisp, you'll sooner or later come to appreciate Emacs, and then will be forever frustrated that we don't build Emacs-like systems anymore. You'll hate Emacs and whenever you do, you'd be reminded that there's no better alternative in existence. Sadly or otherwise.
A road to Lisp: Why Lisp
https://github.com/modus-lisp/modus
Since you can't use an OS by itself, I've rounded out the Common Lisp environment with portable ssh client and server, web browser, and a bitcoin node. Framebuffer with VNC in the pipe
God help me if I fell down a hole like that.
I must say, however, that e.g. code like (compile-compound) is something only an AI can love!
Lisps have many fantastic ideas, but are really hard to read. Lisp code is what we had before perl guys went "hold my beer".
I know its just syntax, and it usually does not matter, untill it does. I did some clojure a long time ago, and before that some CL, and god, i cant understand my own old code. Contrast that to some language that has syntax i can read it still, years later. Go being the prime example of write once, read a decade later.
Once you get hang of it, it easy. Following is video of my son who learnt Scheme as first programming language.