Hacker News new | ask | show | jobs
by kweingar 370 days ago
Why is JS particularly good for agents?
3 comments

I'd say TypeScript is currently the best choice for agents. For one, MCP tooling is really solid, the language itself is easy, fast to develop in, and not esoteric.
The same reason it’s good for web servers. It excels at even-driven applications.
This is a specious argument. It's event-driven because it has callbacks?
“Specious” meaning what exactly?
Because it integrates great with browsers and people know the language already for node.js and the packages in npm can work for both?
A uniform language and ecosystem has been the siren song of JS for over a decade and I've yet to see it work out in any meaningful way.

Use whatever you like.

I mean, what else do you use to run things in the browser?

Pouchdb. Hypercore (pear). It’s nice to be able to spin up JS versions of things and have them “just work” in the most widely deployed platform in the world.

TensorflowJS was awesome for years, with things like blazeface, readyplayer me avatars and hallway tile and other models working in realtime at the edge. Before chatgpt was even conceived. What’s your solution, transpile Go into wasm?

Agents can work in people’s browsers as well as node.js around the world. Being inside a browser gives a great sandbox, and it’s private on the person’s own machine too.

This was possible years ago: https://www.youtube.com/watch?v=CpSzT_c7_UI&t=10m30s

> what else do you use to run things in the browser?

I do my best to run as little in the browser as possible. Everything is an order of magnitude simpler and faster to build if you do the bulk of things on a server in a language of your choice and render to the browser as necessary.

I was wondering if there was something particular about AI, but that's just the standard reason people give to use JS for anything.