Hacker News new | ask | show | jobs
by amluto 67 days ago
Various agent tools (including current versions of codex-rs, which is otherwise a normal Rust program) make effective use of JavaScript/TypeScript for “code mode”. I actually think it’s an excellent choice for this use case. (I think that a less weird language with otherwise similar optimizers and tooling would be even better, but JS/TypeScript is what we have.)

What would even be a good alternative? The language should have no ambient authority, be fully safe, run newly loaded code quickly, and be popular enough that current LLMs are good at it. I think the languages that fit the bill are JS/TypeScript and Lua.

1 comments

> The language should have no ambient authority, be fully safe, run newly loaded code quickly, and be popular enough that current LLMs are good at it. I think the languages that fit the bill are JS/TypeScript and Lua.

JS as a tech stack breaks your "fully safe" constraint (unless you are talking about running a CLI JS application without using npm...)

In this particular instance, I mean JS-the-language, not JS-the-ecosystem with browser and/or npm-style APIs.

codex-rs's code-mode-runtime uses plain V8 and gives it limited capabilities. (It gives it a very strange set of capabilities, but the point is that a program can grant specified capabilities to a JS script that it hosts, and the JS script can use those capabilities and nothing else.)

I suppose I should have added Lisp-like langauges to my list, although those don't have the kind of static type checking that TypeScript can offer.