Hacker News new | ask | show | jobs
by kmeaw 20 days ago
If you give your agent a `bash` or `python -c` tool, it starts a separate process that produces some output and then exits. After that, only the output and the exit code are available.

In contrast, `eval` runs the code in the same execution context as the agent loop. When `eval` finishes, that execution context still exists. For example, any functions defined during an `eval` call remain available for later use.

3 comments

That’s a distinction in search of a reason though.

Being able to run code in the same unix process or a new one doesn’t really matter all that much in the context of self modifying code. But even if we cared about that, this isn’t a LISP specific feature. All dynamic languages support eval.

And having the agent cache the tool for reuse is a really trivial problem to solve. Though I do agree that LISP makes this much easier than in many other languages.

This is certainly a cool tech demo. But the claims of its novelty are overstated

That's technically true but practically an agent can just save the script file/rerun it/write a tool that lets it call a reply with memory etc.This aspect is a bit more elegant when it's in the execution context, but the core of "you don't need to predefine tools, the agent can dynamically write its own code" is not exactly new - that's pretty much the basis of why Claude code and codex and all the other agent harnesses are so much more effective than old ways if working with llms - they can just write giant incomprehensible bash scripts on the fly to accomplish random things without having pre-defined tools, write state to files, etc
Ok yeah fair enough I think thats a sizable distinction. FWIW you can do the same thing inside a python process with eval()/exec(), or if we were still keeping it external to the harness process you could just run python as a persistent process listening to stdin. That way you retain the state from when the last command exited.

I wonder if there are any efficiencies to be gained from running a stateful sidecar process like that or if the LLM will have too much of a hard time juggling the state to make coherent followup calls.