Live data from Hacker News

What's the best programming language for coding agents?

danluu.com

181–190 of 200 posts

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

#181

IMO, rust. Not because it is concise but because you won't need to spend tokens debugging segfaults and a whole spectrum of bugs that the compiler catches. LLMs usually write tests in the same source files so most features are implemented and working in one shot.

I tend to agree in the spirit of this. But more because I believe that Complied and statically typed rigid programming languages tend to be more "software Engineery" than dynamic. That is, as they are more "rigid" and explicit (less ambiguities) at writing time, it will allow to apply (automatically via LLMs) engineering principles, and maintain them.

The main problem with those languages is that they were difficult to write and read for people (their learning curve was steeper); but once that coding doesn't matter with LLMs, they will allow for better control of "automated verification" of the Engineering decisions that system builders do.

I compare it to say the blueprints of houses that Civic Engineers and Architects do, with plumbing lines, electiricy lines, calculations for material tensions, supports, etc. We will enter an era of real "Engineering" in Software which Compliled/Statically-Typed languages will better allow.

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

#182

"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.

Who is claiming AI are self-improving, other than random low signal posts on the internet?

Maybe shouldn't say 'self improving', but 'able to make logical leaps beyond what they learned'.

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

#183
post #91
post #75

Earlier quoted context omitted.

Agree that go is the best due to its main design goal: A language that's simple for any programmer fitting that definition https://news.ycombinator.com/item?id=30688969 . > "They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt." This makes it a great language not just for you…

> is Zig the closest to filling that niche? Given what you said about Go, presumably that is Solod ( https://solod.dev )

Interesting project.

2 gut feeling concerns:

- Strict subset of go might be confusing to an agent actually (trying to use unavailable go features)

- So -> c11 source to source compile loop might be confusing to agent: if So compiles to c11 does it guarantee c11 program compiles. If runtime exception (segfault etc), is it going to be easy for agent to map that back to original So code?

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

#184
post #63

Earlier quoted context omitted.

Why would this be the case when the text that produces binaries (code) is usually both more token efficient and vastly more effectively organized for modification/extension? Unless by bits you just mean text in general, or any data since it’s all bits, in which case what you’re saying is trivially already true. It seems like you’re saying that long term LLMs will output pure machine code as the most effective way to…

token efficiency could become irrelevant in the long term

What about the other thing that’s the actually important part of my reply, modifiability/extensibility? You just chose the weaker of the two factors I provided. And didn’t even provide a convincing argument related to it.

You also didn’t clarify your position at all.

Explain why there is any benefit to outputting raw machine instructions compared to writing shorter, more interpretable, modifiable, extensible code and then using a compiler to turn it into machine code.

Why are agents not going to use compilers in the future?

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

#185

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…

Professionally, Scala was always my favorite language to work in and I was lucky to get to use it most of my career. It is, however, probably the worst language I’ve experienced using with LLMs. Next worst is any dynamic language: it’s just so hard to not introduce strange bugs after iterating on a large-ish project across multiple agent sessions. I’ve had good enough experiences with Rust, but actually OCaml has bee…

having claude to work with has actually been pushing me from ocaml to rust for some of my personal projects. the LLM makes up for the fact that rust is less ergonomic, and being able to pull parts of my project out into libraries that can be called from any language is a rust superpower that is hard to turn down.

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

#186
post #184

Earlier quoted context omitted.

token efficiency could become irrelevant in the long term

What about the other thing that’s the actually important part of my reply, modifiability/extensibility? You just chose the weaker of the two factors I provided. And didn’t even provide a convincing argument related to it. You also didn’t clarify your position at all. Explain why there is any benefit to outputting raw machine instructions compared to writing shorter, more interpretable, modifiable, extensible code and…

I'm not convinced text is more modifiable and extensible than straight bits for a "superintelligence"

The benefit would be that the AI would have true hardware access. It would be unconstrained by gatekeeper protocols.

Would be very powerful, and thereby, potentially dangerous.

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

#187
post #110

Earlier quoted context omitted.

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 cont…

I really don't understand this argument. The "opening tab" in Python has to be matched with an "absence of tab". I don't see any non-cosmetic difference between Python and curly brace languages.

Was going to say the same thing, both of them have to deal with the same amount of context. And curly-braced code will have indents anyway.

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

#188

Earlier quoted context omitted.

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.

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.

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

#189
post #77

So Javascript beats typescript in correctness???

Had the same experience as a human. The time and focus spent on the types wasn't worth the validation it added. I suspect the LLM's issue with it is just the additional token usage, which is sorta analogous.

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

#190
post #93

Earlier quoted context omitted.

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

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.
Post reply on HN