Remix.run Logo
hoppp an hour ago

It's fine but why is Js a good language for agents? I mean sure its faster than python but wouldn't something that compiles to native be much better?

chatmasta an hour ago | parent | next [-]

JS has the fastest, most robust and widely deployed sandboxing engines (V8, followed closely by JavaScriptCore which is what Bun uses). It also has TypeScript which pairs well with agentic coding loops, and compiles to the aforementioned JavaScript which can run pretty much anywhere.

otterley an hour ago | parent | next [-]

Note that "sandboxing" in this case is strictly runtime sandboxing - it's basically like having a separate process per event loop (as if you ran separate Node processes). It does not sandbox the machine context in which it runs (i.e. it's not VM-level containment).

Brass_Hopper 42 minutes ago | parent | next [-]

When you say runtime sandboxing, are you referring to JavaScript agents? I haven't worked all that much with JavaScript execution environments outside of the browser so I'm not sure about what sandboxing mechanics are available.

otterley 16 minutes ago | parent [-]

https://nodejs.org/api/vm.html

Bun claims this feature is for running untrusted code (https://bun.com/reference/node/vm), while Node says "The node:vm module is not a security mechanism. Do not use it to run untrusted code." I'm not sure whom to believe.

Jarred 5 minutes ago | parent [-]

The reference docs are auto generated from node’s TypeScript types. node:vm is better than using the same global object to run untrusted code, but it’s not really a sandbox

Muromec 41 minutes ago | parent | prev [-]

Running it in a chroot or a scoped down namespace is all your need most of the time anyways.

mrcsharp an hour ago | parent | prev [-]

> It also has TypeScript which pairs well with agentic coding loops

The language syntax has nothing to do with it pairing well with agentic coding loops.

Considering how close Typescript and C# are syntactically, and C#'s speed advantage over JS among many other things would make C# the main language for building Agents. It is not and that's because the early SDKs were JS and Python.

chamomeal 32 minutes ago | parent | next [-]

Typescript is probably generally a good LLM language because - static types - tons and tons of training data

Kind of tangent but I used to think static types were a must-have for LLM generated code. But the most magical and impressively awesome thing I’ve seen for LLM code generation is “calva backseat driver”, a vscode extension that lets copilot evaluate clojure expressions and generally do REPL stuff.

It can write MUCH cleaner and more capable code, using all sorts of libraries that it’s unfamiliar with, because it can mess around and try stuff just like a human would. It’s mind blowingly cool!!

wiseowise 24 minutes ago | parent | prev [-]

> C#'s speed advantage over JS among many other things would make C# the main language

Nobody cares about this, JS is plenty fast for LLM needs. If maximum performance was necessary, you're better off using Go because of fast compiler and better performance.

mrcsharp 5 minutes ago | parent [-]

> Nobody cares about this

And that was my point. The choice of using JS/TS for LLM stuff was made for us based on initial wave of SDK availabilities. Nothing to do with language merits.

AstroBen an hour ago | parent | prev [-]

It's widespread and good enough. The language just doesn't matter that much in most cases

moron4hire 26 minutes ago | parent [-]

This is one of those, "in theory, there's no difference between theory and practice. In practice, there is" issues.

In their, quality software can be written in any programming language.

In practice, folks who use Python or JavaScript as their application programming language start from a position of just not carrying very much about correctness or performance. Folks who use languages like Java or C#, do. And you can see the downstream effects of this in the difference in the production-grade developer experience and the quality of packages on offer in PIP and NPM versus Maven and NuGet.

wiseowise 20 minutes ago | parent [-]

> In practice, folks who use Python or JavaScript as their application programming language start from a position of just not carrying very much about correctness or performance. Folks who use languages like Java or C#, do.

Nonsense. Average Java/C# is an enterprise monkey who barely knows outside of their grotesque codebase.

> production-grade developer experience

Please, Maven and Gradle are crimes against humanity. There's a special place reserved for Gradle creators in hell for sure.

The "production-grade" developers should ditch their piece of shit, ancient "tooling" and just copy uv/go/dart/rust tooling.