Live data from Hacker News

What's the best programming language for coding agents?

danluu.com

101–110 of 205 posts

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

#101
post #99

Earlier quoted context omitted.

Go is absolutely one of the best programming languages for LLMs for the reason you say, and Python is just what LLMs like to use to write short throwaway scripts. Frontier LLMs are generally pretty good at most programming languages and can pick up new ones pretty quickly. Training data seems to mostly just increase the speed which they write code, for example, GPTs tend to write Rust and Python faster than other pro…

> Go is absolutely one of the best programming languages for LLMs for the reason you say, and Python is just what LLMs like to use to write short throwaway scripts. And yet this article has pretty strong empirical data to show that your intuition here is incorrect. You should back up your statement with something more than vibes.

Best to read the comments before replying. The article is about correctness, while the parent is talking about output quality.

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

#103

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)?

Pick something slightly esoteric (eg Haskell) and the quality of public code is very high, because you only have enthusiasts writing it. Choose something taught in schools (Python) and you are going to find 10,000 traveling salesmen homework problems and Django todo applications. Not sure how you thread the needle on the quality vs quantity dynamic.

Quantity, it seems is a quality in itself.

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

#104
post #99

Earlier quoted context omitted.

> Go is absolutely one of the best programming languages for LLMs for the reason you say, and Python is just what LLMs like to use to write short throwaway scripts. And yet this article has pretty strong empirical data to show that your intuition here is incorrect. You should back up your statement with something more than vibes.

Best to read the comments before replying. The article is about correctness, while the parent is talking about output quality.

What is output quality without correctness? That seems like a distinction without a difference.

Is the claim that LLMs produce Go code that is superficially nice looking but in fact fail to solve the stated problem? Because that's an anti-Go position I'd say.

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

#105
post #27

It's not clear to me how useful of a signal replicating existing pieces of well-known software is for this kind of evaluation, given what we know about how effectively LLMs can retrieve data from their training corpus and style-transfer it across different settings (programming languages here). That would explain their convergence in ability across different languages on the tasks in this post. I'd be far more intere…

I tried writing an AI harness in Python. Seemed the obvious way to go. Tons of libraries. Libraries for talking to model APIs. Libraries for context and conversation management. Libraries for talking to MCPs. It is the language for LLMs! It was a shit show and just couldn't write anything that would not crash. Super confident it had done a good job. Full of random bugs. A UI needs interactivity, interruption, handlin…

I was recently working on an AI harness too, but I wasn't using AI to code it. It's really easy and requires little code. I wasn't even using langchain - that would require even less code.

UI is harder for sure, but it's not that bad. You need to think though where to catch which exceptions.

LLMs might opt for langchain which has had multiple breaking changes after the knowledge cutoff, making it hard for the LLM to work with it. This is probably going to lead to the LLM having to make many changes to it's code, making it messy and leading to further code being less maintainable.

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

#106
Zstd gets rather easier from dotnet 11, it becomes a near one-limer since it's getting added into System.IO.comoression.

I know this because my agent already knew this the other day when I was evaluating compression, but that's because it has access to search.

That's a key part of what makes agents good coders too, mine is often looking up and downloading the source for how libraries are implemented.

It seems unnatural to air-gap them for evaluation.

I guess they didn't want them just finding an existing library to copy, but it's not very "real-world" to deny the ability to search quickly.

That said, the best language is still just the one you know. No amount of token saving is worth getting a bunch of code back you can't easily understand and review.

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

#107
post #104

Earlier quoted context omitted.

Best to read the comments before replying. The article is about correctness, while the parent is talking about output quality.

What is output quality without correctness? That seems like a distinction without a difference. Is the claim that LLMs produce Go code that is superficially nice looking but in fact fail to solve the stated problem? Because that's an anti-Go position I'd say.

Correctness is binary, while quality is not.

Correctness is a suitable property to act as a multiplier in your formula, where incorrect is 0 and correct is 1, but you also need other facets to find a quality gradient.

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

#108
How good or bad are LLMs on languages that have evolved over the years and aren't popular enough to get hand tuned?

Asking because for non programming, if you use them instead of a wiki for a topic that has had yearly changes for like 10 years they get confused and mix releases like crazy.

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

#109

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…

Go is absolutely one of the best programming languages for LLMs for the reason you say, and Python is just what LLMs like to use to write short throwaway scripts. Frontier LLMs are generally pretty good at most programming languages and can pick up new ones pretty quickly. Training data seems to mostly just increase the speed which they write code, for example, GPTs tend to write Rust and Python faster than other pro…

If you want the opposite experience, try LLMs with an older Oracle Database. Even with the official Oracle SqlDeveloper MCP Server they struggle a lot.

However, I struggle as well and the error messages of Oracle are some of the worst I've ever experienced.

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

#110
post #97
post #78

Python has a less known advantage because it had no curly braces, so LLMs can focus its attention to logic instead of syntax. https://blog.est.im/2026/stdin-11

It's unclear that this is an advantage, certainly not in terms of "logic vs syntax". First of all programs written in curly-brace languages still also have indentation to indicate statement grouping / blocks / scope, even if it's not required, so for a correct program (and that's not deliberately obfuscated), and one that's in the process of being written by an LLM, any advantage there disappears. Furthermore, having…

The thing with LLM is they don't automatically pair parenesis/curly braces like we do with editors/IDEs.

The closing } ) ] token has to be generated to match exactly the beginning { ( [ many lines before. You can challenge yourself writing Lisp by hand without cursor moving backwards, and try close correctly by counting ))))))) you'd have a big headache.

A long, nested sub-routine with many () {} will cost LLM's context and makes it underperform, because the attention head have to track the state. On the other hand the indentation level can be infered as a single token[1] and saves reasoning effort.

Note these discussion is about "code generation", not parsing.

1: https://platform.openai.com/tokenizer Try input many spaces.

Post reply on HN