134 points encyclopedism 5 hours ago 50 comments

vegnus 4 hours ago | parent

[flagged]

embedding-shape 3 hours ago | parent

Not sure what you understand "hammock-driven development" to be for, but it is not a tool meant for producing bug-free implementations.

gingersnap 3 hours ago | parent

Somebody woke up on the wrong side of the hammock

Perz1val 2 hours ago | parent

The underside? Ouch

dmead 3 hours ago | parent

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.

packetlost 3 hours ago | parent

Some of these issues are actually quite bad and don't have anything to do with types at all

jeremyjh 3 hours ago | parent

The article I read described clear correctness bugs unrelated to types.

mtlmtlmtlmtl 3 hours ago | parent

Lisp is not untyped. It is dynamically typed.

lo_zamoyski 1 hour ago | parent

Or as Bob Harper would say, unityped.

flavio81 52 minutes ago | parent

Common Lisp is strongly typed.

I understand Clojure is strongly typed too.

iorekz 3 hours ago | parent

I'm glad I checked your other comments! Beautiful counter bait

articulatepang 3 hours ago | parent

Types have nothing to do with it. For example, the first bug in the article is about an infinite loop in a core data structure:

“[…] reduce it, the call never returns once the vector has 65505 or more elements.”

> These libs don't guarantee anything near to the level that a formal verification would suggest.

This is just plain wrong. A lisp library can absolutely make performance and correctness guarantees, and formal methods can refute or verify those guarantees. A type system is just a special kind of formal method that can rule out certain classes of bugs.

pron 3 hours ago | parent

Even the types in Haskell are far too weak to be included in what we mean by "formal verification" (not to say they're not useful for some things, just that this is not the level of specification that formal verification is typically about). If we rank the strength of properties we can express with types in Clojure as 0 and in Haskell as 3 (or, say, 7 with refinement types), then the strength of types required for formal verification (e.g. in a language like Idris) would be 100.

agentultra 2 hours ago | parent

Indeed. I’ve viewed Haskell not as a high bar to clear. It’s rather low. And most languages don’t even clear it.

Things trickle down to Haskell from higher up but it takes a long time to incorporate them. Dependent Haskell has been in the making for like… 9 years? Maybe more? And it’s still being debated whether Haskell should even adopt it.

The type theory needed for formal proofs is much more advanced at this point. Idris, Agda, Lean, Roq… this is where you need to look to see the 100’s.

krosaen 3 hours ago | parent

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.

nextos 3 hours ago | parent

He has a very elaborate anti-LLM stance: https://www.linkedin.com/pulse/ai-tool-rich-hickey-kjl8e

Sadly, posted on LinkedIn, but in a nutshell, he claims that LLMs are not a tool, they are intrinsic automation.

And by using them, you are kinda giving up.

vegnus 3 hours ago | parent

I was sad when I read this. I thought Clojure + LLMs was like a match made in heaven for some reason

Zambyte 3 hours ago | parent

Interesting, why? Whenever I have used LLMs with Lisps, they always get tripped up balancing parentheses due to the tokenization.

vegnus 3 hours ago | parent

abstraction with macros, minimal syntax (((except these), and giving the LLM direct access to a REPL, to test as stuff is written.

I have used Lisps with LLMs a bit. I toyed around with an indented Lisp I developed with LLMs, to get rid of all the parenthesis, maybe make the LLM more capable of writing it since it looked somewhat closer to Python. I still play around with it, its nice to look at.

casion 3 hours ago | parent

Have written millions of lines of lisp with LLMs (mostly clojure). I have never had this issue in any meaningful quantity comparable to forgetting ; or } (which happens, but is very rare and immediately fixed)

zdragnar 2 hours ago | parent

IME small models definitely fail horribly with lisps. Qwen code and I think I tried 3.6 both choked on closing parens to the point they struggled to get anything at all to ever be syntactically correct.

chuckadams 1 hour ago | parent

I've not regularly run into LLMs generating braces wrong, but what they seem to do every damn day is get the boundaries of replacement regions wrong when using sed or python to make text substitutions, which shows up as unbalanced braces. I've always had a hard time getting consistent compliance when I tell them to use structural editing tools only.

devin 3 hours ago | parent

The REPL loop is really fast for prototyping. The parens balancing thing hasn't been an issue for like 18 months.

cmiles74 2 hours ago | parent

It's one man's opinion, albeit the creator of the language. People will disagree and that shouldn't stop you from doing what works best for you.

Just the other day, someone told me "AI tools can write better code than you, right?", that gave me a chuckle. Yet that attitude is pervasive, I worry it encourages people to let the tool do all of the work. At that point I find myself agreeing with Rich: is it even a tool anymore?

PUSH_AX 2 hours ago | parent

.

vegnus 2 hours ago | parent

I actually just started using other Lisps instead. My opinion is not invalidated at all

waffletower 1 hour ago | parent

"It’s sadder that a person you’ve never met that you’ve put on a pedestal could invalidate your opinion." While not a world record there are multiple straw men in this sentence -- a fire hazard! I think I invalidated some of the de rigeur anti-AI tropes in Rich's post with my reply.

superdisk 1 hour ago | parent

Hmm, I think the opposite. Clojure is very much a human-first language. It's all very "elegant" and fun to write, at the expense of the machine, and thus is very slow. That's the tradeoff you make. LLMs can spit out mountains of boring old C++ without issue, so having them write Clojure is kinda the worst of both worlds.

weavejester 43 minutes ago | parent

Optimized Clojure is on par with Java in terms of performance, which isn't hugely slower than C++. More idiomatic Clojure is less performant, but typically you'll optimize the hot paths.

The main advantage Clojure has in LLM use is that it has a good REPL. LLMs are quite fast at writing code; the bottleneck is often the time it takes to compile and test that code, which is higher for most compiled languages than it is for an open REPL. A LLM writing Clojure typically has a faster iteration loop than one writing C++.

And while I have no hard evidence of this, I also wonder if Clojure's general design philosophy of reducing complexity (i.e. interconnectivity) is also a benefit for LLMs. My experience is that LLMs tend to be more effective the more isolated and unconnected a piece of code is, which Clojure is specifically designed around.

burnte 2 hours ago | parent

Are automations not tools? The same thing can be said about shovels. If you use a shovel, you've given up using your hands, but the shovel is better so why is it bad to give up when you have a better option? Doing everything the hard way isn't intrinsically "better".

mightyham 1 hour ago | parent

You should probably read Rich's post before commenting on it.

geospeck 2 hours ago | parent

There was this post https://news.ycombinator.com/item?id=46415945 almost a year ago regarding his opinion on AI.

geokon 2 hours ago | parent

he has expressed anti-AI opinions but it's apparent he's not really used them extensively

gritzko 2 hours ago | parent

On the practical side, Clojure sits on top of JVM which is humongous and likely unverifiable. On the theory side, very exciting!

functionmouse 2 hours ago | parent

Flash was also absolutely everywhere and humongous and likely unverifiable.

-was-. JVM belongs in the same box.

oblio 1 hour ago | parent

Java will probably be there during humanity's dying hour.

ch4s3 1 hour ago | parent

It’s what the terminators will be running.

rvprasad 2 hours ago | parent

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?"

devin 40 minutes ago | parent

I'm kind of iffy on `(get "abc" 1.9)`. I feel like Clojure has always kind of went out of its way to not go to Ruby levels of implicit dynamism. Think things like: "5" * 3 => "555". Explicit > implicit has been a guiding principle in Clojure since the beginning. For that reason I think the behavior is... a little surprising, but also tend to agree I would stop short of calling it a "bug" in any meaningful sense of the word. I'm curious to see what the core maintainers decide to do about it, if anything. If I were a betting man I'd guess it will stay this way forever because existing programs may quietly (or not-so-quietly) rely on the current behavior.

Hyrum's law, anyone?

> With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.

rvprasad 8 minutes ago | parent

I believe most significant/critical software (written in Clojure) would not pass a float/double as a key in the context of string object. At the same time, instead of evaluating the impact of such a change, the core team may just lean on Hyrum's law and decide to not change the behavior. It is also possible that the core team may just ignore this list.

So, while I prefer changing get's behavior to match our intuition in the context of string objects, I think it could go either way, which is not saying much :)

vitorsr 2 hours ago | parent

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.

vemv 30 minutes ago | parent

It's because these are darker, dusty corners of the language that people would use extremely rarely, and not at all for practically any commercial domain.

haolez 18 minutes ago | parent

Is this still true? Or is Clojure a small piece of the puzzle nowadays?

siscia 1 hour ago | parent

I really need to learn Lean and these testing mechanism

networked 1 hour ago | parent

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?

pona-a 1 hour ago | parent

Maybe the author is not an experienced researcher in this field, and was simply jumping on the hype-wagon of LLM-powered auto-formalization, and Lean recently had disproportional publicity.

estherney 1 hour ago | parent

I do think that Sledgehammer-like tooling in Rocq and Isabelle has historically been the main reason why these languages have been used for program correctness, however of course LLMs have completely diminished this advantage.

As for why Lean is now used: I guess it's just frontier labs having configured their RLVR environments for Lean? Not sure why, though intuitively I think of Mathlib.

dnautics 59 minutes ago | parent

Wasn't lean built to verify programs?

throwforfeds 4 minutes ago | parent

There's a great, quick read on the history of Lean [1] that I read a couple months ago and yes, the original project's intent was for verifying programs.

[1] https://www.quantabooks.org/books/the-proof-in-the-code/

yababa_y 14 minutes ago | parent

I found dozens of issues in sbcl, clozure, and ACL2 as well: https://github.com/emberian/common-lisp-compiler-audit