Live data from Hacker News

What's the best programming language for coding agents?

danluu.com

31–40 of 204 posts

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

#31

Is there a relationship between how good a programming language is for coding agents and how popular it is among humans? If so, wouldn't Python be the best language for agents, since it's is the most popular (and hence has the most context available for models)?

There is definitely a relationship. But I personally believe that once the training corpus reaches a certain scale, the returns exhibit diminishing marginal effects, to the point that multiplying the data volume cannot surpass something essential inherent in language design. (Asked an LLM to help me with the translation, so forgive my expression)

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

#33
Any good LLM service (not just coding-focused ones) will write and run ad hoc code without being asked if your prompt involves lots of data. Gemini and Claude tend to pick Python with maybe some SQLite. Some of that must be due to portability alone, but it also means they'll make sure the model and tooling are good at those.

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

#35
post #34

What is the best language for the user of the LLM? What is the best language to have high quality correctness oracles so that the user doesn't have to babysit the LLM and do lots of manual testing?

JS is the best tradeoff between succinct and easy to understand. Python is next but has some rough edges that they avoided in JS.

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

#36

Cool line of questioning, but one piece of information is pivotal and critically not-yet-included: equivalent accomplishments in each language. For example, if I want to write standard things: web server, memoized fibonnaci, recipe search engine, what's the length-and-density of these outputs for each language? I think that would add in some ~normalization.

[deleted]

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

#37
Ive been amazed at how well LLMs are at writing Gleam[1] and Lustre[2]. Compared to a mainstream language, there is basically zero gleam code in the training data.

I have no evidence to back this up, but I suspect that languages that are good for humans[3] will be good for LLMs. Compiled, strongly typed, statically typed, immutable, pure functions, pattern matched, memory safe, etc.

[1] https://gleam.run [2] https://lustre.hexdocs.pm [3] Yes I realize that languages features that are "good for humans" is a hotly debated topic. That's just my personal list for what I like in a language.

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

#38

Is there a relationship between how good a programming language is for coding agents and how popular it is among humans? If so, wouldn't Python be the best language for agents, since it's is the most popular (and hence has the most context available for models)?

As much as I love Python, JavaScript (including TypeScript) is probably more popular.

That and JS code is more readily available in the source of tons of webpages, not hidden away in some backend

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

#40

> Dynamically typed languages generally have a lower LLM token cost than traditional statically typed languages because omitting explicit type declarations makes the code more compact. If this was true, the programming languages that are very much on the left side of > https://danuker.go.ro/programming-languages.html#non-math-ma... > https://danuker.go.ro/programming-languages.html#overall-map should be very ideal fo…

> omitting explicit type declarations makes the code more compact.

I guess this ignores languages with type inference? Hindley-Milner and others

Post reply on HN