问HN:什么使得一种编程语言在代码生成方面表现出色?

2作者: keithasaurus9 个月前原帖
目前,编程语言的受欢迎程度似乎是判断大型语言模型(LLM)是否能够熟练生成可用代码的最佳指标(例如,Python、JavaScript、Java、C等)。然而,我认为,那些需要较少额外推理(和/或令牌?)的语言可能会使LLM更频繁地生成可用代码。例如,我想不可变性对于LLM来说可能比局部可变性更容易“推理”。严格的格式、显式类型、简洁的语法等也可以做类似的推测。基于这种推理,我可能会期待函数式语言特别适合作为目标。 有没有证据支持这些观点?是否应该(或者已经有)考虑到LLM而开发的编程语言?我们会看到开发者更倾向于使用LLM更擅长的语言吗?
查看原文
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&#x2F;or tokens?) could allow LLMs to produce working code more often. For instance, I would imagine immutability to be easier for an LLM to &quot;reason&quot; 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.<p>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?