Live data from Hacker News

What's the best programming language for coding agents?

danluu.com

191–200 of 200 posts

Re: What's the best programming language for coding agents?

#191
post #68

Earlier quoted context omitted.

You don't need that, gets in the way more than it helps. Even Typescript isn't really needed, but at least it's decent devex unlike the Python typing stuff. What really helps is testing.

I try to capture as much as possible in types/schemas/constraints (then lint rules) and then only as a last resort write tests. And as few and complementary as possible. And I want a functional core with unit tests and imperative shell and not a bunch of complex mocks. ¯\_(ツ)_/¯

Some kind of testing is needed if you care at all about it being reliable, whether or not you have type checks. It can just be a few simple tests like a smoke. You don't need tests that directly check for correct types. If you're using a wrong type somewhere, it'll become obvious. Without type checks, I've never had a bug in prod caused by wrong types, it's always something else.

Re: What's the best programming language for coding agents?

#192
post #179

Earlier quoted context omitted.

Similarly contrary: I don't know why people aren't talking more about Python. Am I interpretting the final vs. graph incorrectly? I've got some education in materials engineering; it'd be trivial to drop a curve (line) for optimizing the language selection, and Python obviously comes out on top. The author doesn't even mention it. That discredits the whole article as far as I'm concerned.

You are the one cherry picking perhaps the first two charts. Look at the various metrics at the end in the Zstd vs Pandoc charts. There is just no clear advantage for Python across those metrics which are the one you really want to know about! If anything F# seems like a better top of the line language?!

I'm exclusively using the third chart. The selection process would naively be y=mx+b with some reasonable variables. It would be a downward diagonal (you would move it right until only a few remained), and you would pick the one farthest from the line, which is obviously Python.

Edit: I misread the chart! It would indeed be F#

Re: What's the best programming language for coding agents?

#193

> Most of the claims that get thrown around about how a particular language is good for LLM use seem to be wrong (e.g., the claim that Ruby, Clojure, and J, are particularly well suited to LLMs, which were mentioned in the evals linked above, as well as the somewhat common claim that Elixir is particularly suited to LLMs), but it's not clear what's right. I feel this is a missed opportunity to explore the architectur…

You are not 100% correct. Modules in Elixir are like namespaces, they contain functions. They're "static" and don't communicate with anything. Processes communicate with each other via messages.

Re: What's the best programming language for coding agents?

#195

"Languages with a lot of bad code out there (e.g., PHP) will perform worse " This is what tells me that AI's are not 'self improving'. If they could read a manual and understand it, then they should come up with better solutions. Not just regurgitate bad slop they learned from bad examples.

That was one of the predictions that turned out to be wrong, though.

Re: What's the best programming language for coding agents?

#196

Earlier quoted context omitted.

Your point is a good one: Exotic, difficult languages attract enthusiasts with deeper skills than a median developer. Haskell also has a confounding issue: Because of its focus on research and experimentation, standard best practices don't exist like they do in languages optimized for real-world use. Because there are few community guidelines, engineering practices vary widely, and unfortunately at the same time, Has…

Was going to ask what is the Numpy equivalent in Haskell. Cause Python has a thousand decent examples of how to do everything you might want to do in Numpy.

[flagged]

Re: What's the best programming language for coding agents?

#197

I'm not sure I trust a source that says "just 70 tokens average, nearly half of Clojure (109 tokens)". There's no reason to add the phrase "nearly half of", and there's especially no reason to add it when it's significantly far away from half. But on the main topic, I still feel that Go is an excellent choice for LLMs. There is pretty much just one way of doing most things, and the available training data is pretty c…

I’ve gone down the same logical pattern of using Go for llms even though I personally prefer Clojure.

I am working on two projects these days, one in Go and one in Clojure and anecdotally, I prefer clojure. (Easier to review, better iteration cycles through repl, cleaner and more concise code, better domain modelling)

Re: What's the best programming language for coding agents?

#198

This is a great discussion: I wonder though if we are asking the right question. Yes, absolutely language choice can play a large role in the efficiency of coding agents. The point about Rust is right: static typing provides a fast verification loop at compile time. I would argue though that the way the codebase is composed could actually generalize the concept of "easy verifiability" past the actual coding language.…

> I wonder though if we are asking the right question

I also wonder. Is there no further design thought, research or discussion on how to better modularize a program to address complexity - in an LLM world?

Instead, we still can’t move beyond arguing about languages

Re: What's the best programming language for coding agents?

#200
post #93

Earlier quoted context omitted.

JS gives you wrong answers silently when thigns go sideways since for the original browser use case, they didn't want scripts to ever stop execution. It's the opposite of Python in this respect.

Yes Py is stricter, but you pay for that with more verbosity, which in turn makes it more error-prone. And the kind of strictness it adds barely helps.

I feel Python is more concise. Looking at a couple of Rosetta Code examples, they are shorter for Python as well.

Also the post referenced by the article lists Python taking noticeably less tokens than Javascript.

Post reply on HN