Comment by baq

22 days ago

the irony is the repl way of working is extremely well suited for agentic workflows. rust is nice, but lisp is hiding in plain sight

I'm currently working on a project that uses Tcl as its primary programming language. One of the great features about the Tcl interpreter is that it lets you introspect things like variables and procedures at runtime. You also get the full source code of procedures at runtime, even those that were themselves defined at runtime. Instead of the normal work flow of having Claude make changes, starting up a web service, testing the web service with some Javascript driver code, I instead work through Claude in Chrome and expose a web-based interpreter from within the running web service itself. I can instruct Claude to make changes at runtime and immediately after making that change, the code can be tested by Claude. Those changes can then be dumped to disk and reincorporated back into the base source code I have. Not something you'd want to expose to the wider internet, but it's let me move _very_ quickly and build out apps within minutes. I've considered making use of Tcl's safe-interpreter mechanism so other Claude instances could possible collaborate within the same primary app without stepping on each other.

Yep, it's incredible. What you lose in typing and borrow checking you absolutely gain back in absolute raw power

Which models have you found most take advantage of this kind of capability? Opus 5.5 and GPT-6 Sol and Astra seem to like to minimize their tool calls, blatting out a single edit with dozens of lines of code in it rather than editing a few at a time. And they virtually never use things like the Python REPL, even though they use Python all the time.

It seems sort of wasteful of tokens!

  • > And they virtually never use things like the Python REPL, even though they use Python all the time.

    REPLs in non-homoiconic languages like Python, and homoiconic Lisp do differ. Every single step in Read-Eval-Print-Loop does. That's why Lispers sometimes refer to Lisp REPL as a "true REPL", because in practical comparison, Python's REPL is more like an "interactive shell". Homoiconic means that code-is-data, and the Read step in REPL doesn't need to do any acrobatics with parsing, building AST, etc, it's just directly reading the code and passing to Eval as is.

    Here's a sense of what it looks like to be writing software with Lisp: https://youtu.be/tHgApFhevrQ?t=2272 I purposely moved the marker so you don't have to watch the whole talk. Jeaye here coded his entire presentation from inside a terminal, embedded into a game.

    That's how typically Lispers write software - "from inside out". Lisp, uniquely fits for LLMs, because when you give them a Lisp REPL, they stop guessing and start empirically analyzing current state of things and produce working solution faster, costing fewer tokens.

    The typical flow with non-homoiconic PLs is is roughly the Unix/pipe model - batch-style. Agent spawns process -> reads stdout/stderr -> spawns next process. State lives in-between the calls and in files. Each tool invocation technically stateless. It is a whole different story with Lisp.

    > It seems sort of wasteful of tokens!

    Clojure is proven to be one of the most token efficient languages. https://tokencalculator.ai/most-token-efficient-languages-fo...

    • You seem to have misunderstood this remark:

      > It seems sort of wasteful of tokens!

      This was referring to the LLMs' tendency to blat out hundreds of tokens into a single tool call, not to Clojure.

      The REPL in the part of the presentation you link to only evaluates two forms, (range 10) and (bounce!), neither of which takes much advantage of homoiconicity.

      cchase88 was talking about a degree of homoiconicity in Tcl that has been abandoned by most dialects of Lisp:

        : ~; tclsh
        % proc deproc {name} {return [list proc $name [info args $name] [info body $name]]}
        % deproc deproc
        proc deproc name {return [list proc $name [info args $name] [info body $name]]}
      

      (That might look wrong, but it's actually correct. In Tcl the list {name} is exactly the same as the quasiquoted string "name" and the bare word name.)

        % proc ack {m n} {
            if {$m == 0} {
                expr {$n + 1}
            } elseif {$n == 0} {
                ack [expr {$m - 1}] 1
            } else {
                ack [expr {$m - 1}] [ack $m [expr {$n - 1}]]
            }
        }
        % deproc ack
        proc ack {m n} {
            if {$m == 0} {
                expr {$n + 1}
            } elseif {$n == 0} {
                ack [expr {$m - 1}] 1
            } else {
                ack [expr {$m - 1}] [ack $m [expr {$n - 1}]]
            }
        }
      

      You can't do that in Racket or SBCL, but it does exist in Clojure; it's clojure.repl/source. However, the part of the presentation you link to doesn't use anything similar, and it's not really a mainstream part of Lisp development anymore, the way it was 50 years ago.

      3 replies →

  • in lisp the repl is the primary mode of development, you replace functions one at a time and only reload the whole system if you break structure layouts, and even then you don’t really restart the whole process (most of the time anyway, sbcl’s immobile code space is a bit of a pain) - agents can and do things by themselves, unprompted, which look like magic even if you’ve been piloting llms for as long as anyone here. I use gpt 6.1 sol for this, I’m sure opus would handle it perfectly, too.

It's ridiculous how stubborn programmers could be. They'd cling to their beloved Blub paradigms and almost cultishly refuse to accept clearly pragmatic takes, sitting just in front of their eyes.

Of course, there's no tool without flaws. Nevertheless, oh boy, how amazingly practical Lisp-dialects can be in reality (even with all their imperfections), it's just astounding. Sometimes I think maybe it is some kind of ego-defeating stance or whatever, maybe smart programmers just can't believe how the stupidly simple idea of Lisp can ever satisfy their galaxy-sized brains? To me, Lisp is like a boundless sea of incredible idea generation on the spot, turning it into practical reality like some magic. Effortlessly, painlessly, and with joy.

I don't know, maybe I had to go through the pain of learning the intricacies of a dozen different stacks, using them for years, only to discover Lisp later in my life. Perhaps I wouldn't know the difference otherwise?

Just the other day, I was watching a YT video, which I of course fully control directly from Emacs - that is very useful for taking notes. I can mute, pause, speed-up, rewind, toggle subs, etc. All while typing a message, a note, or while looking at a PR diff. I thought, "hmm, floating window would be nice". Without even missing a beat, I opened eca-emacs buffer, I didn't even have to type the prompt - I used speech-recognition. Agent then (running in Elisp REPL), connected to my WMs REPL driven by Fennel, using tools in my Clojure-made harness with its own REPL, tapped into the lua-based mpv, analyzed things on the fly and just built the solution, right there. I didn't even have to compile, restart, reload, refresh anything. Now I can detach a video playing in the browser into mpv window and later put it back. With a press of a key.

It's almost as if Lisp has been quietly waiting for this moment. LLMs and Lisp REPLs make such a great duo - if you're a programmer and haven't seen it in practice yet, you should seriously be experiencing deep FOMO right now.