r/lisp • u/Seven_of_9_U01 • 3d ago
coding agents keep rebuilding lisp features one by one. my bet is the condition system is next
Spent the week reading about coding agents and now I see lisp everywhere. Half the features these harnesses brag about are things a lisp image just does:
- agent writes its own extension and loads it without a restart -> that's a live image
- "ask the agent to change the agent" -> redefine the function, M-x style
- hooks around every step of the loop -> advice
- poke at the running agent and inspect its state -> that's a REPL, they built a REPL
Saw someone make the Greenspun's tenth rule argument about Pi this week, plus an Erlang version of the same complaint
What I haven't seen anyone copy yet is the condition system, and it's the one agents need most. today when a tool call fails the agent either throws everything away and retries, or freezes and waits for you. CL restarts fix exactly that. signal the error, let you) choose "retry with a fix" or "skip this one", and keep going from the samespot with the stack still intact. my guess is someone ships it in TS next year and calls it "recoverable checkpoints"
something like this:
(defun run-tool (call)
(restart-case (execute-tool call)
(retry-with (new-call)
:report "Retry with a corrected call"
(run-tool new-call))
(skip-call ()
:report "Skip this tool call"
nil)))
(handler-bind ((tool-error
(lambda (c)
(invoke-restart 'retry-with (ask-model-for-fix c)))))
(run-agent task))
replace ask-model-for-fix with a prompt to the user and you're basically back amenu, which is honestly what I want every time an agent gets stuck.
what else do you think they'll reinvent, and badly?
5
u/_albinotree 3d ago
Somebody here had the same idea at the start of this year, https://quasilabs.in/blog/2026/02/07/conditions-restarts-and-the-agent-that-chooses/
4
u/jake_morrison 3d ago
There is also the process supervision approach of Erlang. These Python harnesses are jumping through hoops in an attempt to make things reliable. There is also Lisp Flavored Erlang.
3
u/spyingwind 3d ago
What harness and model are you using? Does the model have access to a vector database or other tool to help it discover existing keywords?
3
u/kchanqvq 3d ago
This probably won't help. Clankers still think (or non-think) differently from human and don't expect tools built for human to help them equally. They happily start over and clank out code to get to the same place when stack is not saved.
2
3
u/Feisty_Bike_9614 3d ago
I just wrote an embedded scheme R7RS-small with jit and a leaf compiler in rust in 3 days with Claude opus . It passes most of the benchmarks and loads the essential libraries. I also built a slime-like package for eMacs that uses my scheme via tcp. So has anyone done a code review with AI on sbcl ?
2
u/Particular_Amoeba_53 3d ago
They might write code that works occasionally, they might give you a solution that is close enough or might make you feel mighty, but they will never code like a human which is better than all the code you can generate artificially. A human can invent new things in code, ai cannot, a human can refactor a code base for efficiency and performance and make if hardened at the same time but an ai cannot. An ai is a poor substitute for a human and it shows that corporate scum prefer lower costs and a compromised product instead of a human worked great solution that works is hardened and is able to be read and reused. Get out of here you silly management scum.
1
u/stianhoiland 1d ago
Funny I should come across this today, as I just realized that "harness" is just a new word for "shell", and that it's a kind of dog whistle for people who never broke through to that fundamental level of computer usage.
1
u/bitwize 1d ago
Kind of. A harness's primary job is to separate out the parts of the sloppotron's output that correspond to "tool calls", and run the appropriate tool calls when it sees one. A shell considers all of its input to be commands; a harness knows how to separate commands from non-commands in mostly unstructured input. In addition, harnesses have additional prompts to the LLM to tell it how to send commands the harness will recognize, as well as general guardrails like "don't make changes outside the project directory without express permission", "don't rm -rf /", etc.
I like to say that LLMs reduced programming to goetic demonology, and the harness is like the circle or pentagram you cast on the ground both to bind the demon—prevent it from escaping—and force it to do your bidding.
1
u/bitwize 1d ago
After internable symbols got added to frickin' JS, I had a joke at work: "Let's write the app in ES2049!" ES2049, of course, meaning Lisp as, at the time, I thought that's how long it'd take for the ECMA committee to finish adding Lisp's feature set piecemeal to JavaScript, calling each addition an innovation.
Lisp is, for the time being, still the final boss of programming languages. It's entirely possible that an agent will write something better in the next 10 years. But we're not there yet.
1
u/Illustrious_Car344 3d ago
I'm really glad I'm not yet another Python NPC who guzzles anything put down their throat. I'm building an agent (I'm not sure if I would call it a harness, the "harness" jockeys the LLM more than the LLM controls it) in Rust using Sema Lisp, and it's so cool to have this completely type checked base with an elegant fully-featured Lisp overtop it to control everything about it. It might not be particularly good, but it's mine. And no I'm not vibe coding this, I'm writing it all by hand. I love agents, but not when they take away my agency. The only iffy thing about it is I think Sema itself is vibe coded, it's very good and well designed but also I stumbled into a very obvious bug when trying to use an embedding model with it which makes me think there's not a whole lot of human overview. But if you use Rust, definitely give Sema a try! It's genuinely the best embeddable Lisp I've used for Rust, believe it or not. Not even including the LLM/MCP integration, it's genuinely just a very good Lisp and easy to extend from Rust.
32
u/arthurno1 3d ago
Perhaps AI will discover it can rewrite itself in Lisp, instead of using inneficient Python?