I checked Clojure's core with Lean and found unreported bugs

encyclopedism 207 points 71 comments November 25, 2026
s.conao3.com · View on Hacker News

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

Semantic search powered by Rivestack pgvector
4,151 stories · 37,739 chunks indexed