Live data from Hacker News

An agent in 100 lines of Lisp

thebeach.dev

31–40 of 84 posts

Re: An agent in 100 lines of Lisp

#31
post #6

Littered with AI writing tells.

is that wrong though? you write all your code with AI already, but you still need to supervise and steer it. same with blog posts - as long as you steer it towards converying your point, it doesn't matter the text itself was written by AI rather than typed by you, does it?

It doesn't matter if a human or a machine wrote it, it's just unpleasant to read. I don't know what the OP's motivation for their post was, but I think it's reasonable to point out that something is harder to read than it should be.

Re: An agent in 100 lines of Lisp

#32
post #12

Earlier quoted context omitted.

This doesn't need to be posted on every post. Everyone that cares is well aware. It's like saying "this was written in english" on every post.

Why should I bother reading something that the “author” couldn’t even be bothered to write themselves?

he's sharing an idea, not "text". text is just a medium.

Re: An agent in 100 lines of Lisp

#33

Earlier quoted context omitted.

Why should I bother reading something that the “author” couldn’t even be bothered to write themselves?

Similarly, why should I be bothered reading this kind of comment in each and every discussion thread? What does it contribute? I can read and discern this for myself, I can then stop reading or decide I don’t care. Seriously, at some point all you “ai writing sleuths” should just get your own discussion thread together. It’s been months of this , we get it already. (Not directly just at you, but anyone who feels the…

> why should I be bothered reading this kind of comment in each and every discussion thread?

To help other people who don't care about it so they can skip it. A subject tag would be nicer.

> It’s been months of this , we get it already.

And I am tired of the constant barrage of AI proselytizing.

Re: An agent in 100 lines of Lisp

#34

Earlier quoted context omitted.

> I see Rust macros as the closest thing that demonstrates homoiconicity in mainstream Algol-based languages I don't know if you consider Elixir mainstream, but IMO their macro system is much closer to lisp's ideal. Elixir is basically Lisp, but with better syntax, a modern ecosystem, and running on the Beam. Unlike languages like Rust, Elixir's conditionals and function definitions are just calls in the AST, even th…

> Elixir is basically Lisp, but with better syntax Which so helpfully removes many of the benefits of lisps :P I don't understand this argument at all, if it's not s-expressions nor quacks like a lisp, in what way is it lisp at all? Making it algol/C-like already makes it like the rest of the 99% of the languages, without any of the easy benefits of the neat and simple syntax of lisps.

Agreed. You can tell when someone “gets it” or not by whether they see sexprs as a problem to be overcome or a benefit to be embraced. Count me firmly in the benefit camp.

Re: An agent in 100 lines of Lisp

#35
So, writing an agent in Lisp is interesting but not particularly novel. If there’s a big idea here it’s giving Lisp’s eval function to the AI as a tool. Yes, AIs write Python and Bash all day long already, but those scripts are run out of process. In this case, the AI can modify the process running the harness, extending it directly and potentially changing it (evolving it). That’s powerful. And obviously quite dangerous. Definitely only for a sandbox. But I wonder how far that can go…

Re: An agent in 100 lines of Lisp

#36
post #35

So, writing an agent in Lisp is interesting but not particularly novel. If there’s a big idea here it’s giving Lisp’s eval function to the AI as a tool. Yes, AIs write Python and Bash all day long already, but those scripts are run out of process. In this case, the AI can modify the process running the harness, extending it directly and potentially changing it (evolving it). That’s powerful. And obviously quite dange…

Now this is AI going full circle, back to their roots. Yeah, I want to see that system working.

Re: An agent in 100 lines of Lisp

#37

I like Lisp, I’ve used Common Lisp with a passion, but this doesn’t seem like a valid argument for Lisp. Homoiconicity, as I understand, is that the code is structured data that is easy to programmatically modify, hence allowing Lisp macros. While some might disagree, I see Rust macros as the closest thing that demonstrates homoiconicity in mainstream Algol-based languages, as Rust macros modify the loosely structure…

It's not just eval. It's LISP macros what makes it an interesting powerful language for agents.

Re: An agent in 100 lines of Lisp

#38

I like Lisp, I’ve used Common Lisp with a passion, but this doesn’t seem like a valid argument for Lisp. Homoiconicity, as I understand, is that the code is structured data that is easy to programmatically modify, hence allowing Lisp macros. While some might disagree, I see Rust macros as the closest thing that demonstrates homoiconicity in mainstream Algol-based languages, as Rust macros modify the loosely structure…

> Homoiconicity, as I understand, is that the code is structured data that is easy to programmatically modify

I think a more accurate description is that lisp code is just cons cells and cons cells is both how we write the code and how the runtime itself implements lists. So there’s basically no distinction between a lisp list and the text representation of the source. Rust and its macros is a different situation because the text representation of the code and the syntax tree have completely different shapes

Re: An agent in 100 lines of Lisp

#39
post #6

Littered with AI writing tells.

> No framework. No state machine. The agent’s state is just ...

Indeed. The new language, llmish, has definitely been used.

Still a good TFA IMO.

P.S: this particular construct "No X. No Y. ... just ..." is half my LinkedIn feed.

Re: An agent in 100 lines of Lisp

#40
post #35

So, writing an agent in Lisp is interesting but not particularly novel. If there’s a big idea here it’s giving Lisp’s eval function to the AI as a tool. Yes, AIs write Python and Bash all day long already, but those scripts are run out of process. In this case, the AI can modify the process running the harness, extending it directly and potentially changing it (evolving it). That’s powerful. And obviously quite dange…

There is no good reason for running this in-process. The maximally inefficient Fibonacci function in the article is a good demonstration why: Call it with a slightly larger number, and your agent slows to a crawl, with no way to enforce a timeout. Call it with a slightly larger number yet, and you might bring your agent down entirely, with no way to recover.

There is a case to be made for a dynamically evolving "tool server", but it should be a separate process. That would be more flexible for other use cases too. For example, multiple independent agent processes could talk to one shared tool server. Like a blackboard system, more classic AI!

And if you really do want to evolve the agent itself: As the article observes, its entire state can be serialized. Nothing is gained from hanging on to one particular agent process. Serialize its state, ask the tool server to kill it, rewrite its code, then start the new version and replay the state.

Post reply on HN