Live data from Hacker News

A case for Go as the best language for AI agents

getbruin.com

91–100 of 310 posts

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

#91
post #64
post #38

Earlier quoted context omitted.

Rust is the best language for AI: - Rust code generates absolutely perfectly in Claude Code. - Rust code will run without GC. You get that for free. - Rust code has a low defect rate per LOC, at least measured by humans. Google gave a talk on this. The sum types + match and destructure make error handling ergonomic and more or less required by idiomatic code, which the LLM will generate. I'd certainly pick Rust or Go…

https://arxiv.org/abs/2508.09101 In this benchmark, models can correctly solve Rust problems 61% on first pass — A far cry from other languages such as C# (88%) or Elixir (a “buggy dynamic language”) where they perform best (97%). I wonder why that is, it’s quite surprising. Obviously details of their benchmark design matter, but this study doesn’t support your claims.

This is great, but aug 2025 is almost a lifetime ago with how fast these models are improving. Opus 4.5 came out November 2025 fwiw

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

#92
I think Go isn't bad choice. It is widely popular, so I'd assume there's plenty of it in training sets and has stable APIs, so even "outdated code" would work. There's also rich ecosystem of static analyzers to keep generated code in check.

On the other hand I think Rust is better by some margin. Type system is obviously a big gain but Rust is very fast moving. When API changes LLMs can't follow and it takes many tries to get it right so it kinda levels out. Code might compile but only on some god-forgotten crate version everybody (but LLM) forgot about.

From personal experience Haskell benefits the most. Not only it has more type system usage than Rust, but its APIs are moving on snail-like pace, which means it doesn't suffer from outdated Rust and code compilable will work just fine. Also I think that Haskell code in training sets is guaranteed to be safe because of language extension system.

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

#93
post #33

Earlier quoted context omitted.

Have also wondered how Haskell would be. From my limited understanding it’s one of the few languages whose compiler enforces functional purity. I’ve always liked that idea in theory but never tried the language

You can write in it like in imperative languages. I did it when I first encountered it long time ago, and I didn’t know how to write, or why I should write code in a functional way. It’s like how you can write in an object oriented way in simple C. It’s possible, and it’s a good thought experiment, but it’s not recommended. So, it’s definitely not “enforced” in a strict sense.

Isn’t code in Haskell pure by default and you have to use special keywords to have code with side effects?

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

#94
post #60
post #5

I think the more you can shift to compile time the better when it comes to agents. Go is therefore 'ok', but the type system isn't as useful as other options. I would say Rust is quite good for just letting something churn through compiler errors until it works, and then you're unlikely to get runtime errors. I haven't tried Haskell, but I assume that's even better.

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.

[dead]

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

#95

Earlier quoted context omitted.

Why is this a meaningful distinction to you? What does "reason" mean here? Can we construct a test that cleanly splits what humans do from what LLMs do?

Sure, things like counting the ‘r’s in strawberry, for example (till they are retrained not to make that mistake).

There are humans that can't do that but are clearly capable of reasoning. Not a meaningful categorical split.

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

#96

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…

Wow that is wild, that is exactly along the lines of my fantasy language. It'd be so easy to go into the deep end building tooling and improving a language like this.

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

#97
post #5

I think the more you can shift to compile time the better when it comes to agents. Go is therefore 'ok', but the type system isn't as useful as other options. I would say Rust is quite good for just letting something churn through compiler errors until it works, and then you're unlikely to get runtime errors. I haven't tried Haskell, but I assume that's even better.

Exactly. Here's my experience using LLMs to produce code: - Rust: nearly universally compiles and runs without fault. - Python,JS: very often will run for some time and then crash The reason I think is type safety and the richness of the compiler errors and warnings. Rust is absolutely king here.

I ve just vibed for 2 weeks a pretty complex Python+Next.js app. I've forced Codex into TDD, so everything(!) has to be tested. So far, it is really really stable and type errors haven't been a thing yet.

Not wanting to disagree, I am sure with Rust, it would be even more stable.

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

#98
post #31

If code is now free, why does the language matter at all?

Because you'll have to review it, and Go's design limits the number of ways it can go wrong. Code is free, sure, but it's not guaranteed to be correct, and review time is not free.

If code must be correct, and review time is not free, and review time is costlier than code time, why not just ...

... write the code yourself?

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

#99
post #5

I think the more you can shift to compile time the better when it comes to agents. Go is therefore 'ok', but the type system isn't as useful as other options. I would say Rust is quite good for just letting something churn through compiler errors until it works, and then you're unlikely to get runtime errors. I haven't tried Haskell, but I assume that's even better.

Idris would be even better.

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

#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 to adopt agentic coding workflows at my consultancy [0], Go delivers highly consistent results via Claude and Codex regularly and more often than working with clients using TypeScript and/or Python.

When LLMs have to navigate Python and TypeScript there is a massive combinatorial space of frameworks, typing approaches, and utility libraries.

Too much optionality in the training distribution. The output is high entropy and doesn't converge. Python only dominated early AI coding because ML researchers write Python and trained on Python first. It was path dependence, not merit.\

The thing nobody wants to say is that the reason serious programmers historically hated Go is exactly why LLMs are great at it: There's a ceiling on abstraction.

Go has many many failings (e.g. it took over a decade to get generics). But LLMs don't care about expressiveness, they care about predictability. Go 1.26 just shipped a completely rewritten go fix built on the analysis framework that does AST-level refactoring automatically. That's huge for agentic coding because it keeps codebases modern without needing the latest language features in training data or wasting tokens looking up new signatures.

I spent four years building production public key infrastructure in Golang before LLMs [1]. After working coding agents like everyone else and domain-switching for clients - I've become more of a Go advocate because the language finally delivers on its promise. Engineers have a harder time complaining about the verbose and boilerplate syntax when an LLM does it correctly every single time.

[0]: https://sancho.studio

[1]: https://github.com/zoom/zoom-e2e-whitepaper

Post reply on HN