Hacker News new | ask | show | jobs
by tester89 15 hours ago
What is the benefit of using clojure now? Used to be a big Lisp head before AI, but with AI I feel like using widely-used statically-typed, strongly-typed languages is better over Lisp, for the training set and validation benefits.
5 comments

Listened to this a couple days ago: https://m.youtube.com/watch?v=tzzg8CVkl2A

Besides immutability and iterating with the repl, another point made was apparently more efficient context window usage due to fewer lines of Clojure code compared to alternatives.

Cool talk. I've expected Lisps to be the winner for these reasons.

Here is a similar talk from Anurag Mendhekar at the European Lisp Symposium a year ago:

Is Lisp Still Relevant in the New Age of AI? [video]

https://news.ycombinator.com/item?id=50671492

Yes! That's the reason why I chose it - due to iterations with repl and extremely efficient context window usage / token expenditure. Effectively, for the use case scenario of my project, Clojure can express logic and functionalities that are shown on screen with just a couple of lines of code, removing all the boilerplate/overhead code.
> statically-typed, strongly-typed languages is better over Lisp

Nope, in practice, that point turned out to be not exactly accurate. Giving an agent access to the "true Lisp REPL" makes it stop guessing and start empirically analyzing the current state of things. It reaches decisions faster, costing far fewer tokens. You just need to build a proper, "Lisp-aware" harness.

It looks like they are just borrowing clojure syntax (I like), and perhaps the culture of supporting hot code reload (I also like), but I share the same reservations.
Both are valid points and some of the reasons why + the fact that it is super "token friendly" allowing to express logic and have functionalities expressed in just a couple of lines
obv I could clone and ask an AI but since you're here, https://github.com/RiccardoSottini/AffrescoUI/blob/master/ex... is a limited syntax definition for the built-in markdown parser?

I went down a similar path using smalltalk. Then as I started to play whack-a-mole with UI edge cases (live markdown editor), the loop became tedious because I had to use the app to find the interaction bugs (what to do about link rendering when the cursor enters, leaves, and when exactly to prettify and unprettify), while suspecting that this has been solved 100x over in javascript land. Sure enough, when I moved to bb, I had to pull in a lot of libs, which is a lot of pregenerated tokens, but those were battle tested tokens.

I guess it has to be done though, as long as you bring a new stack.

The same features that help humans also help agents. For example, immutability as the default helps minimize the scope an LLM needs to track in order to make a change correctly. Clojure being concise and expressive also helps reduce the amount of tokens the LLM needs to use which directly shrinks the context. The language is also data focused, so the LLM can inspect any data or state trivially. And nREPL driven workflow provides the agent with a fast feedback loop where it can try things and iterate step by step.
Live editing running applications.

You could be using your app to solve some problem, and just modify it instantly with a prompt to just-in-time add a new feature. No need to shift between “using the app” mode and “programming the app” mode.

Yes, those are the main points. I believe that it is also fundamental to also maintain versioning and data migrations, so, each time you try edit/add a new feature, you can switch between the different versions/rollback - and most importantly you do not compromise data - as there's a fine line between full software malleability that has no control of any sort (and issues can arise) - and a framework that allows such an experience but has some sort of "guardrails".
I mean that's just any language with a REPL?
Every stage in Read-Eval-Print-Loop differs. So it's not "just any language with a REPL", no. Lispers call Lisp REPL "a true REPL", not for emotional reasons, for quite practical ones.
Image based languages are fundamentally different from others and the similarities end at "has a repl"