Live data from Hacker News

A case for Go as the best language for AI agents

getbruin.com

161–170 of 310 posts

Re: A case for Go as the best language for AI agents

#161
post #100

I've been saying this for maybe nine months vis-à-vis my consulting work keeps proving it. Go is an excellent language for LLM code generation. There exists a large stable training corpus, one way to write it, one build system, one formatter, static typing, CSP concurrency that doesn't have C++ footguns. The language hasn't had a breaking version in over a decade. There's minimal framework churn. When I advise teams…

> Python only dominated early AI coding because ML researchers write Python and trained on Python first. It was path dependence, not merit. Python doesn’t need dependence to prove its merit. There’s a reason why it is one the major programming languages and was top 1 for a while.

It is easy to get started in. Some of the major warts it has, at least the ones that annoy me, revolve around deployment and management. Python packaging has been "fixed" at least 6 times

Re: A case for Go as the best language for AI agents

#162
post #60

Earlier quoted context omitted.

Was asking on mastodon if people tried leveraging very concise and high level languages like haskell, prolog with 2025 llms.. I'm really really curious.

the problem there might be limited training data?

Jane Street had a cool video about how you can address lack of training data in a programming language using llm patching. Video is called "Arjun Guha: How Language Models Model Programming Languages & How Programmers Model Language Models"

The big take away is that you can "patch" llms and steer them to correct answers in less trained programming languages, allowing for superior performance. Might work here. Not a clue how to implement, but stuff to llm-to-doc and the like makes me hopeful

Re: A case for Go as the best language for AI agents

#163

I have let Gemini, Claude Code and Codex hallucinate the language they wanted to for a few days. I prompted for "design the language you'd like to program in" and kept prompting "go ahead". Just rescued it from a couple too deep rabbit holes or asked it for some particular examples to stress it a bit. It´s a weird-ass Forth-like but with a strong type system, contracts, native testing, fuzz testing, and a constraint…

This is actually quite impressive, especially as AI vibe-coded slop. How easy is the language to learn for novice coders, compared to other FORTH lookalikes?

Re: A case for Go as the best language for AI agents

#164
post #65

Earlier quoted context omitted.

I built an agent with Go for the exact reasons laid out in the article, but did consider Rust. I would prefer it to be Rust actually. But the #1 reason I chose Go is token efficiency. My intuitive sense was that the LLM would have to spent a lot of time reasoning about lifetimes, interpreting and fixing compiler warnings, etc.

"LLM would have to spend a lot of time reasoning about lifetimes" Let's set aside the fact that Go is a garbage collected language while Rust is not for now... Do you prefer to let LLM reason about lifetimes, or debugging subtle errors yourself at runtime, like what happens with C++? People who are familiar with the C++ safety discussion understand that lifetimes are like types -- they are part of the code and are ju…

For many (most) types of objects lifetimes can be a runtime property just fine. For e.g. a list, in rust/c/c++ you would have to do an explicit decision how long should it be "alive", meanwhile a managed language's assumption that when it's reachable that is its lifetime is completely correct and it has the benefit of fluidly adapting to future code changes, lessening maintenance costs.

Of course there are types where this is not true (file handlers, connections, etc), and managed languages usually don't have as good features to deal with these as CPP/Rust (raii).

Re: A case for Go as the best language for AI agents

#165
post #115
post #100

I've been saying this for maybe nine months vis-à-vis my consulting work keeps proving it. Go is an excellent language for LLM code generation. There exists a large stable training corpus, one way to write it, one build system, one formatter, static typing, CSP concurrency that doesn't have C++ footguns. The language hasn't had a breaking version in over a decade. There's minimal framework churn. When I advise teams…

> But LLMs don't care about expressiveness, they care about predictability. I think this is true, but it misses a very key point. Go does an impressively bad job at designing APIs that are difficult to misuse, so LLMs will misuse them and will require also writing unit tests to walk through it, just to validate it used the libraries correctly. This isn't always possible (or is awkward/cumbersome) for certain scenario…

Go is not difficult to maintain at large scale, I mean take Kubernetes for example, it's "trivial" to understand and modified even though it's in the millions loc.

Re: A case for Go as the best language for AI agents

#166

Go has govulncheck[0] for static analysis of vulnerabilities in both code and binaries. The govulncheck tool has first-class support in the Go ecosystem. No other language has this level of integration with a static analyzer and at best will only analyze for known vulnerable modules (PLEASE CORRECT ME IF I'M WRONG). [0] https://go.dev/doc/tutorial/govulncheck

It sounds like you think govulncheck can analyze your code and detect vulnerabilities that you wrote in your code. That's not what it does. It analyzes the libraries that you use and determines if you are using them in a vulnerable way. For a free tool, govulncheck is somewhat nicer than average in its class because it does call flow analysis and won't claim you're vulnerable just because you used a module, you have to actually have a call that could go over the vulnerable code, but "somewhat nicer than average" is as far as I would take it. But many languages have similar tools, and when you say "static analyzer" this isn't what I have in mind. For that I'd cite golangci-lint, which is a collection of community-built analysis tools, and it's nice to be able to pick them all up in one fell swoop, but they're nothing like Coverity or any real static analysis tool.

Re: A case for Go as the best language for AI agents

#167

> I have worked with PHP, Go, JavaScript, and Python in a professional capacity for over 10 years now. Well if it's a choice between these 4, then sure. Not sure that really suffices to qualify Go as "the" best language for agents

what would you prefer? i liked rust a lot as i found the compiler feedback loop pretty great, but the language was much more verbose and i found the simplicity of Go to be great, and the typing system is good enough for almost everything.

Elixir works pretty well with the LLMs

Re: A case for Go as the best language for AI agents

#168

Strange article. Why is Go the best language for agents instead of, say, Python? Here are the points the author seems to make: --- # Author likes go Ok, cool story bro... # Go is compiled Nice, but Python also has syntax and type checking -- I don't typically have any more luck generating more strictly typed code with agents. # Go is simple Sure. Python for a long time had a reputation as "pseudocode that runs", so t…

I would say Go is better then python for 2 reasons

1) Go runs faster, so if you're not optimizing for dev time (and if you're vibe coding, you're not) then it's a clear winner there

2) Python's barrier to entry is incredibly low, so intuitively there's likely a ton of really terrible python code in the training corpus for these tools

Re: A case for Go as the best language for AI agents

#169

I have let Gemini, Claude Code and Codex hallucinate the language they wanted to for a few days. I prompted for "design the language you'd like to program in" and kept prompting "go ahead". Just rescued it from a couple too deep rabbit holes or asked it for some particular examples to stress it a bit. It´s a weird-ass Forth-like but with a strong type system, contracts, native testing, fuzz testing, and a constraint…

Interesting project, but I believe the base assumption is already slightly wrong. Why do we assume that LLMs know what kind of language would benefit them? This information is not knowable without doing proper research, and even if there is some research like that, it would have to be a part of the training data. Otherwise it's just hallucination.

Re: A case for Go as the best language for AI agents

#170
Yeah, Go is probably the best general purpose language at the moment.

Rust is great, but there's no need to manage memory manually if you don't need to.

So for general mainstream languages, that leaves ... Python. Sure, it's ok but Go has strong typing from the start, not bolted on with warts.

(I realized how incredibly subjective this comment turned out to be after I had written it. Apologies if I omitted or slighted your fave. This is pretty much how I see it).

Post reply on HN