I checked Clojure's core with Lean and found unreported bugs
encyclopedism
207 points
71 comments
November 25, 2026
Related Discussions
Found 5 related stories in 55.5ms across 4,151 title embeddings via pgvector HNSW
- Clojure will affect the way you think about programming (2017) sammatilda · 33 pts · November 21, 2026 · 53% similar
- Jolt – Clojure that speaks C michaelsbradley · 101 pts · November 16, 2026 · 51% similar
- Interpreting claims that a theorem is correct because it was checked in Lean matt_d · 294 pts · November 16, 2026 · 48% similar
- Clj.rs – a Clojure dialect implemented in Rust simonpure · 173 pts · November 04, 2026 · 47% similar
- A DrRacket style editor for Clojure with some Lisp Machine inspired features yogthos · 24 pts · November 13, 2026 · 47% similar
Discussion Highlights (8 comments)
dmead
I'm not sure the lisp community could consider these bugs. Lisp/clojure/scheme etc is inherently untyped. These libs don't guarantee anything near to the level that a formal verification would suggest. If this were the haskell standard lib however, that would be news.
krosaen
Having long admired clojure and Rich, I wonder what Rich makes of AI / agentic coding. I can imagine him having something really interesting and surprising to say, or being very anti-AI in an entertaining and persuasive way that ultimately feels destined to be a losing argument.
gritzko
On the practical side, Clojure sits on top of JVM which is humongous and likely unverifiable. On the theory side, very exciting!
rvprasad
While the effort is interesting, I found two issues in the list. First, (.indexOf (seq (byte-array [1 2 3])) 2) fails because byte arrays store bytes and the argument 2 to `.indexOf` is a Long value. Simple type checking (via eyeballing) could have flagged the incorrect usage. I think such exercises can be more helpful if we can reduce the noise. Second, (get "abc" 1.9) fails because `get` coerces the given key to integer in the context of string objects, which makes sense; specifically in the context of weakly typed language. That said, I believe that detailed documentation of the behavior of `get` can help clients just as well as returning `nil` or not-found value. However, we are still left with questions such as "who and where do we draw the line about the dynamism of the language?" and "what is the agreed upon semantics that we are checking against?"
vitorsr
That is interesting, given heavy hitters like Nubank (Brazilian digital bank) basically runs on Clojure, having bought / acquihired Rich's Cognitect. I would normally expect such primitive types and functions to be spotless.
siscia
I really need to learn Lean and these testing mechanism
networked
So this kind of work is done in Lean now, too? Based on a glimpse into the world of dependently typed languages in the 2010s, I assumed Rocq (formerly Coq) was used to verify program correctness. Are language models significantly better at writing Lean than Rocq?
yababa_y
I found dozens of issues in sbcl, clozure, and ACL2 as well: https://github.com/emberian/common-lisp-compiler-audit