Ask HN: What makes a programming language great for code generation?

3 keithasaurus 2 5/22/2025, 4:54:13 PM
At the moment, it seems programming language popularity might be the best indicator of whether an LLM will be proficient at generating working code (e.g. Python, JavaScript, Java, C). However, it seems plausible to me that languages which require the least amount of extra reasoning (and/or tokens?) could allow LLMs to produce working code more often. For instance, I would imagine immutability to be easier for an LLM to "reason" about than local mutability. The same could be said for strict formatting, explicit types, concise syntax, etc. By that reasoning I might expect functional languages to be particularly good targets.

Is there any evidence supporting these ideas? Should there be (or are there already) languages developed with LLMs in mind? Will we see developers pushed more toward languages that LLMs are more proficient at?

Comments (2)

lendacerda · 3h ago
Yes you need good amounts of data for the LLM to learn the language. But after some point, the easyness of the language is more important. Python and Javascript (or TS) are kings

Ideally, you dont wanna LLM to reason. You yourself should understand the problem and the better solution for it, and then the AI just executes on it

Bostonian · 4h ago
I think you want a language where code that compiles is more likely to be correct code. Code that does not compile is only an annoyance, since it can't make its way into production.