Comment by hoppp

Comment by hoppp 14 hours ago

41 replies

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 14 hours ago

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 13 hours ago

    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 13 hours ago

      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.

    • Muromec 13 hours ago

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

  • locknitpicker 10 hours ago

    > It also has TypeScript which pairs well with agentic coding loops, (...)

    I've heard that TypeScript is pretty rough on agentic coding loops because the idiomatic static type assertion code ends up requiring huge amounts of context to handle in a meaningful way. Is there any truth to it?

    • miguelspizza 8 hours ago

      Not sure where you heard this but general sentiment is the opposite.

      There was recently a conference which was themed around the idea that typescript monorepos are the best way to build with AI

      • locknitpicker 4 hours ago

        > Not sure where you heard this but general sentiment is the opposite.

        My personal experience and anecdotal evidence is in line with this hypothesis. Using the likes of Microsoft's own Copilot with small simple greenfield TypeScript 5 projects results in surprisingly poor results the minute you start leaning heavily on type safety and idiomatic techniques such as branded types.

        > There was recently a conference which was themed around the idea that typescript monorepos are the best way to build with AI

        There are also flat earth conferences.

        • conartist6 3 hours ago

          It's especially tricky since monorepos are an obvious antipattern to begin with. They're a de-separation of concerns: an encouragement to blur the unit boundaries, not write docs, create unstable APIs (updating all usages at once when they change), and generally to let complexity spread unchecked.

    • aizk 5 hours ago

      I think this is contingent on the skill of the human reviewing the AI's code.

    • [removed] 9 hours ago
      [deleted]
  • mrcsharp 13 hours ago

    > 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 13 hours ago

      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!!

      • miguelspizza 8 hours ago

        Clojure is such an underrated language for vibe coding for this very reason.

        Makes me wonder what a theoretical “best possible language for vibe coding” would look like

    • wiseowise 13 hours ago

      > 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 12 hours ago

        > 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 14 hours ago

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

  • moron4hire 13 hours ago

    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.

    • drzaiusx11 11 hours ago

      As a developer that switches between java, python and typescript every day I think this is fairly myopic opinion. Being siloed to one lang for long enough tends to brings out our tribalistic tendencies, tread carefully.

      I've seen codebases of varying quality in nearly every language, "enterprise" and otherwise. I've worked at a C# shop and it was no better or worse than the java/kotlin/typescript ones I've worked at.

      You can blame the "average" developer in a language for "not caring ", but more likely than not you're just observing the friction imposed by older packaging systems. Modern languages are usually coupled with package managers that make it trivial to publish language artifacts to package hubs, whereas gradle for example is it's own brand of hell just to get your code to build.

    • AstroBen 12 hours ago

      That's not a fair comparison. In your example, you're talking about the average of developers in a language. In this situation, it's specific developers choosing between languages. Having the developers you already have choose language A or B makes no difference to their code quality (assuming they're proficient with both)

      • moron4hire 10 hours ago

        These are statements these developers will make themselves. They will say they don't like more strictly typed languages because they feel constrained and slowed down in development. They will argue that the performance hit is worth the trade offs.

    • justatdotin 5 hours ago

      perhaps many of those 'Folks who use languages like Java or C#'

      do so because a boss told them 'thats the way we deal with correctness and performance around here'

      the fact that their boss made that one decision for them does not somehow transmit the values behind the one decision.

    • wiseowise 13 hours ago

      [flagged]

      • rishabhaiover 12 hours ago

        Exactly! In the Java ecosystem, your intelligence is measured by how elaborate an interface hell you can conjure just to do CRUD.

      • CharlieDigital 11 hours ago

            > Nonsense. Average Java/C# is an enterprise monkey who barely knows outside of their grotesque codebase.
        
        Netflix is Java. Amazon is mostly Java. Some of the biggest open source projects in the world are Java. Unity and Godot both use C# for scripting.

        I don't know where you're getting the impression that Java and C# are somehow only for "enterprise monkey who barely knows outside of their grotesque codebase"

        • wiseowise 4 hours ago

          > Netflix is Java. Amazon is mostly Java. Some of the biggest open source projects in the world are Java. Unity and Godot both use C# for scripting.

          You can add Meta, Google and Palantir to your list and it won’t change that average Java dev is from an Eastern hemisphere and knows nothing about Java outside of JavaEE/Spring.

          See how generalizations work?

      • mrcsharp 11 hours ago

        Chill out buddy. You're going to pop a vein here.

        A typical backend developer using C#/Java is likely solving more complicated problems and having all the concerns of an enterprise system to worry about and maintain.

        Dismissing a dev or a system because it is enterprisy is a weak argument to make against a language. A language being used a lot in an enterprise to carry the weight of the business is a sign the language is actually great and reliable enough.

        • wiseowise 4 hours ago

          I’m not dismissing Java, I’ve spent decades writing it and know what it is capable of, but it is laughable to hear that average Java dev cares more about performance or correctness than Python/JS dev.

          All of them explicitly don’t have to care about performance from the start because of VMs + GC, only when scale starts to matter you start to optimize.

          Tooling argument is especially funny to me, given how shit tooling ecosystem is. Sure it is ol’ reliable, but average Java dev is so stuck in their ways that they’ve never even tried to dwell out of their Java cave to see what’s out there.

          IntelliJ consuming ALL of RAM, literally as much as it can get hands on. Gradle taking what’s left, rebuilds taking minutes to complete or requiring elaborate setup to have proper hot reload. Both TS and Python have far more expressive and powerful type systems than even modern Java. “Production grade tooling” my ass.

          Funny to see Java shmucks looking down at JS/Python folks, as if Java at the time wasn’t picked for literally same reasons as Python/JS nowadays.

aizk 5 hours ago

TS is enormous, has endless training data, and can interact with virtually anything on the Internet these days. Also, strong typing is very very useful for AI coding context.

  • justatdotin 4 hours ago

    > strong typing is very very useful for AI coding context

    what makes you think so?

    I believe strong typing is very very useful for human coding,

    I'm not convinced its so 'very very' for agents.

    • matwood 3 hours ago

      When I've use agents with TS, failing tests due to typing seems to help the agent get to the correct solution. Maybe it's not required though.

      • tubthumper8 3 hours ago

        What do you mean by "failing tests", are you talking about runtime code? TypeScript erases all types at compile so these wouldn't affect tests. Unless you meant "compile errors" instead.

        I've noticed LLMs just slap on "as any" to solve compile errors in TypeScript code, maybe this is common in the training data. I frequently have to call this out in code review, in many cases it wasn't even a necessary assertion, but it's now turned a variable into "any" which can cause downstream problems or future problems

        • matwood 3 hours ago

          My code has tests and the LLM wrote more tests.

          I tell the LLM to include typing on any new code.

          The agent is running the test harness and checking results.