I've been saying this for maybe nine months vis-à-vis my consulting work keeps proving it.<p>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.<p>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.<p>When LLMs have to navigate Python and TypeScript there is a massive combinatorial space of frameworks, typing approaches, and utility libraries.<p>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.\<p>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.<p>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.<p>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.<p>[0]: <a href="https://sancho.studio" rel="nofollow">https://sancho.studio</a><p>[1]: <a href="https://github.com/zoom/zoom-e2e-whitepaper" rel="nofollow">https://github.com/zoom/zoom-e2e-whitepaper</a>
Most of these reasons apply to Java as much, if not more.<p>It's an even more popular language with even more training data and also has a better type system so more validation on LLM output, etc.
Certainly not the "one way to write it" idea. Java has a ton of language features.
Except that Go is a simpler, smaller language than Java. That's one of the key points in the post.
I wonder what people will say to that.<p>I personally think neither Go nor Java would be good for "agents". Better to have them sandboxed in WASM.
> Python only dominated early AI coding because ML researchers write Python and trained on Python first. It was path dependence, not merit.<p>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.
> But LLMs don't care about expressiveness, they care about predictability.<p>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 <i>will misuse them</i> and will require also writing unit tests to walk through it, <i>just</i> to validate it used the libraries correctly. This isn't always possible (or is awkward/cumbersome) for certain scenarios like database querues.<p>All of the reasons people argue Go is good for LLMs are <i>more true</i> for Rust. You and the LLM can design libraries to be difficult to misuse, and then get instant feedback from the compiler to the LLM about what it did wrong, and often with suggestions about how it should fix them! This also makes RL deriving from compiler feedback more effective.<p>This allows the LLMs to reason more abstractly at larger scales, since the abstractions are less leaky (unlike in Go). The ceiling on abstraction screws you here, since troubleshooting requires more deep diving. It's the same reason Go projects become difficult for humans at large scales, too.
Rust is unstable and slow to compile. I think these two features make it bad for LLMs and everything else.
Rust is harder for the bot to get "wrong" in the sense of running-but-does-the-wrong-thing, but it's far less stable than Go and LLMs frequently output Rust that straight up doesn't compile.
A lot of those pros apply to c# as well. Which claude and gemeni both do very well with.
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.<p>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.<p>I haven't tried Haskell, but I assume that's even better.
I absolutely love Rust, but due to the space it occupies there is simply more to specify in code, and more things to get wrong for a stochastic LLM.<p>Lifetimes are a global property and LLMs are not particularly good at reasoning about them compared to local ones.<p>Most applications don't need low level memory control, so this complexity is better pushed to runtime.<p>There are lots of managed languages with good/even stronger type systems than Rust, paired with a good modern GC.
I think Rust is great for agents, for a reason that is rarely mentioned: unit tests are in the same file. This means that agents just "know" they should update the tests along with the source.<p>With other languages, whether it's TypeScript/Go/Python, even if you explicitly ask agents to write/run tests, after a while agents just forget to do that, unless they cause build failures. You have to constantly remind them to do that as the session goes. Never happens with Rust in my experience.
+1 to Rust - if we're offloading the coding to the clankers, might as well front-load more complexity cost to offload operational cost. Sure, it isn't a particularly ergonomic or simple language but we're not the ones who have to use it.
Haskell is great, for what it's worth, but as with any language you have to reign in the AI's use of excessive verbosity. It will stack abstractions to the moon even for simple projects, and haskell's strengths for humans in this regard are weaknesses for AI - different weaknesses than other languages, but still, TANSTAAFL<p>I am trying out building a toy language hosted on Haskell and it's been a nice combo - the toy language uses dependent typing for even more strictness, but simple regular syntax which is nicer for LLMs to use, and under the hood if you get into the interpreter you can use the full richness of Haskell with less safety guardrails of dependent typing. A bit like safe/unsafe Rust.
> Haskell is great, for what it's worth, but as with any language you have to reign in the AI's use of excessive verbosity. It will stack abstractions to the moon even for simple projects, and haskell's strengths for humans in this regard are weaknesses for AI - different weaknesses than other languages, but still, TANSTAAFL<p>I haven't had this problem with Opus 4.5+ and Haskell. In fact, I get the opposite problem and often wish it was more capable of using abstractions.
I've been cruising on rust too, not just because it works great for LLMs but also the great interop:<p>- I can build SPAs with typescript and offload expensive operations to a rust implementation that targets wasm<p>- I can build a multi-platform bundled app with Tauri that uses TS for the frontend, rust for the main parts of the backend, and it can load a python sidecar for anything I need python for (ML stuff mainly)<p>- Haven't dived too much into games but bevy seems promising for making performant games without the overhead of using one of the big engines (first-class ECS is a big plus too)<p>It ended up solving the problem of wanting to use the best parts of all of these different languages without being stuck with the worst parts.
Exactly. Here's my experience using LLMs to produce code:<p>- Rust: nearly universally compiles and runs without fault.<p>- Python,JS: very often will run for some time and then crash<p>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.<p>Not wanting to disagree, I am sure with Rust, it would be even more stable.
Calling a programming language without dependent types king of type safety is comical.<p>Does one get paid well to post these advertisements for Rust?
I’m not sure they’re saying rust is king of types, they’re saying it’s king of llm targets.
What will you use for dependent types, Idris 2? Lean? None are as popular as Rust especially counting the number of production level packages available.
Isn’t dependent types replicating the object oriented inheritance problem in the type system?
No, unless you mean the problem of over-engineering? In which case, yes, that is a realistic concern. In the real world, tests are quite often more than good enough. And since they are good enough they end up covering all the same cases a half-assed type system is able to assert anyway by virtue of the remaining logic needing to be tested, so the type system doesn't become all that important in the first place.<p>A half-assed type system is helpful for people writing code by hand. Then you get things like the squiggly lines in your editor and automated refactoring tools, which are quite beneficial for productivity. However, when an LLM is writing code none of that matters. It doesn't care one bit if the failure reports comes from the compiler or the test suite. It is all the same to it.
This is quite sad to see someone react to a comment they disagree with by assuming that different opinion is paid for. I'd love it if you dug into my comment history and found even a shred of evidence that I'm being paid to talk positively about my programming language of choice.<p>I hope there aren't many of your type on here.
All comments are paid for in some way, even if only in "warm fuzzies". If that is sad, why are you choosing to be sad? But outlandish comments usually require greater payment to justify someone putting in the effort. If you're not being paid well, what's the motivation to post things you know don't make any sense to try and sell a brand?
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.
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.
I think the intersection of FP and current AI is quite interesting. Purity provides a really tightly scoped context, so it almost seems like you could have one 'architect' model design the call graph/type skeleton at a high level (function signatures, tests, perf requirements, etc.) then have implementers fill them out in parallel.
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.
I've built tools with both Go and Rust as LLM experiments, and it is a real advantage for Go that the test/compile cycle is much faster.<p>I've been successful with each, I think there's positives and negatives to both, just wanted to mention that particular one that stands out as making it relatively more pleasant to work with.
"LLM would have to spend a lot of time reasoning about lifetimes"<p>Let's set aside the fact that Go is a garbage collected language while Rust is not for now...<p>Do you prefer to let LLM reason about lifetimes, or letting yourself debug subtle errors at runtime, like what happens with C++?<p>People who are familiar with the C++ safety discussion understand that lifetimes are like types -- they are part of the code and are just as important as the real logic. You cannot be ambiguous about lifetimes yet be crystal clear about the program's intended behavior.
It's not a waste of time though. Those warnings and clippy lints are there to improve the quality of the code and to find bugs.<p>As a human I can just decide to write quality code (or not!), but LLMs don't understand when they're being lazy or stupid and so need to have that knowledge imposed on them by an external reviewer. Static analysis is cheap, and more importantly it's automatic. The alternative is to spend more time doing code review, but that's a bottleneck.
I've never actually seen it get a compiler issue arising from lifetimes, so it seems to one-shot that stuff just fine. Although my work is typically middle of the road, non-HFT trading applications, not super low-level.
LLMs don't "reason".
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?
Take it up with OpenAI's API designers—it's their term
Haskell works pretty well with agents, particularly when the agent is LSP-capable and you set up haskell-language-server. Even less capable models do well with this combo. Without LSP works fine but the fast feedback loop after each edit really accelerates agents while the intent is still fresh in context
I've been using LLMs (Opus) heavily for writing Haskell, both at work and on personal projects and its shockingly effective.<p>I wouldn't use it for the galaxy brain libraries or explorations I like to do for my blog but for production Haskell Opus 4.5+ is really good. No other models have been effective for me.
I am guessing there is a balance between a language that has a lot of soundness checks (like Rust) and a language that has a ton of example code to train on (like Python). How much more valuable each aspect is I am not sure.
Rust is the best language for AI:<p>- Rust code generates absolutely perfectly in Claude Code.<p>- Rust code will run without GC. You get that for free.<p>- 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.<p>I'd certainly pick Rust or Go over Python or TypeScript. I've had LLMs emit buggy dynamic code with type and parameter mismatches, but almost never statically typed code that fails to compile.
<a href="https://arxiv.org/abs/2508.09101" rel="nofollow">https://arxiv.org/abs/2508.09101</a><p>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%).<p>I wonder why that is, it’s quite surprising. Obviously details of their benchmark design matter, but this study doesn’t support your claims.
The downside is that even simple Rust projects typically use hundreds of dependencies, and this is even worse with LLMs, who don’t understand the concept of “less is more”.
What about SPARK? Not enough training data?
Idris would be even better.
Of my friend group the two people I think of as standout in terms of getting useful velocity out of AI workflows in non-trivial domains (as opposed to SaaS plumbing or framework slop) primarily use Haskell with massive contexts and tight integration with the dev env to ground the model.
Have yet to find a better choice than OCaml:<p>- Strongly typed, including GADTs and various flavors of polymorphism, but not as inscrutable as Haskell<p>- (Mostly) pure functions, but multiple imperative/OO escape hatches<p>- The base language is surprisingly simple<p>- Very fast to build/test (the bytecode target, at least)<p>- Can target WASM/JS<p>- All code in a file is always evaluated in order, which means it has to be defined in order. Circular dependencies between functions or types have to be explicitly called out, or build fails.<p>I should add, it's also very fun to work with as a human! Finding refactors with pure code that's this readable is a real joy.
How's the multicore and async story these days? I remember that was one of the big draws of F# originally, that it had all (or, most of) the type safety features of OCaml but all the mutlicore of dotnet. (Plus it created async before even C# had it). Has OCaml caught up?
OCaml has full multicore support with algebraic effects now. The effect system makes things like async very nice as there's no function "coloring" problem: <a href="https://discuss.ocaml.org/t/ocaml-5-0-0-is-out/10974" rel="nofollow">https://discuss.ocaml.org/t/ocaml-5-0-0-is-out/10974</a><p>But I don't believe the effects are tracked in the type system yet, but that's on it way.
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.<p>It´s a weird-ass Forth-like but with a strong type system, contracts, native testing, fuzz testing, and a constraint solver for integer math backed by z3. Interpreter implemented in Elixir.<p>In about 150 commits, everything it has done has always worked without runtime errors, both the Elixir interpreter and the examples in the hallucinated language, some of them non-trivial for a week old language (json parser, DB backed TODO web app).<p>It´s a deranged experiment, but on the other hand seems to confirm that "compile" time analysis plus extensive testing facilities do help LLM agents a lot, even for a weird language that they have to write just from in-context reference.<p>Don´t click if you value your sanity, the only human generated thing there is the About blurb:<p><a href="https://github.com/cairnlang/Cairn" rel="nofollow">https://github.com/cairnlang/Cairn</a>
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.
Have you asked them to compile it to BEAM bytecode directly?
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.<p>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.<p>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.
> I have worked with PHP, Go, JavaScript, and Python in a professional capacity for over 10 years now.<p>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.
Yeah, only one of these is a compiled language.
C.f., from 25d ago:<p>“Why Elixir is the best language for AI” <a href="https://news.ycombinator.com/item?id=46900241">https://news.ycombinator.com/item?id=46900241</a><p>- for comparison of the arguments made<p>- features a bit more actual data than “intuitions” compared to OP<p>- interesting to think about in an agent context specifically is runtime introspection afforded by the BEAM (which, out of how it developed, has always been very important in that world) - the blog post has a few notes on that as well
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).<p>[0] <a href="https://go.dev/doc/tutorial/govulncheck" rel="nofollow">https://go.dev/doc/tutorial/govulncheck</a>
I've read these arguments and they make perfect sense; but having tried different projects rewritten in Go vs Python (with Claude & Cursor); Python was just significantly faster, smaller, and easier to understand for Claude. It was done faster, and made less mistakes. I don't mean faster as execution time, but the code for its Python projects was almost a magnitude smaller. So it was done by the time its Go counterpart was halfway. Maybe it's gotten better, or I need some kind of "how to Go" skill for Claude... But just didn't work out of the box _for me_ as well as Python did. I tried a couple projects rewritten in different languages; Go, Kotlin, Python, Javascript. I settled with Python. (My own background is in Kotlin, Java and C++.)
I wonder if this is why there's been a huge uptick in the visibility of Go related content. I've seen more posts about Go in the last few days then I had in the last year.
Shameless plug - I sort of eluded in this post I wrote about Dark Factories generally and about rust being better than Go for building software (not just agents) with AI - but I think something generally important is feedback loops. While not all feedback loops are created equal and some will be superior, my argument is that holistic approach of including diverse, valuable feedback loops matters more.<p><a href="https://bernste.in/writings/the-unreasonable-effectiveness-of-external-feedback-loops/" rel="nofollow">https://bernste.in/writings/the-unreasonable-effectiveness-o...</a>
Yeah, I don't care for go but I expect it to win here. Its performance is good enough for most use cases, it has a huge ecosystem of libraries, lots of training data, and deploys as a binary so users don't need to install anything else.<p>I expect rust to gain some market share since it's safe and fast, with a better type system, but complex enough that many developers would struggle by themselves. But IME AI also struggles with the manual memory management currently in large projects and can end up hacking things that "work" but end up even slower than GC. So I think the ecosystem will grow, but even once AI masters it, the time and tokens required for planning, building, testing will always exceed that of a GC language, so I don't see it ever usurping go, at least not in the next decade.<p>I <i>wish</i> the winner would be OCaml, as it's got the type safety of rust (or better), and the development speed of Go. But for whatever reason it never became that mainstream, and the lack of libraries and training data will probably relegate it to the dustbin. Basically, training data and libraries >>> operational characteristics >>> language semantics in the AI world.<p>I have a hard time imagining any other language maintaining a solid advantage over those two. There's less need for a managed runtime, definitely no need for an interpreted language, so I imagine Java and Python will slowly start to be replaced. Also I have to imagine C/C++ will be <i>horrible</i> for AI for obvious reasons. Of course JS will still be required for web, Swift for iOS, etc., but for mainstream development I think it's going to be Rust and Go.
Every agent I've seen in Go has been so straightforward. Take exe.dev's Shelley. Great example of clean code and very effective tooling. Worth a try if you haven't used it.
This is an opinion piece without any benchmarks, some valid points there but all anecdotal. Hard to take it seriously, feels like cargo culting into a preference.
Doesn't the high quantity of boilerplate pollute the context, thereby making agents less useful over time? i.e. go is not "token efficient"
Language models need redundancy (as informing structure). Not surprising, since they're trained on human language. It's hard to train a model on a language with a high entropy. I haven't tried it, but I think LLMs would perform quite badly on languages such as APL, where structure and meaning are closely intertwined.
I wonder how many tokens are spent generating: if err != nil {return err} for large programs and over a long period of time.<p>May be this is good incentive to improve error handling in Go.
In this thread, people who like Go talking about how good Go is
Right now, I'd say the best language for AI is the one that you can review the fastest and rarely changes. Go is fairly readable imo and never changes so it is probably a good contender. But, I can't see any reason for anyone to learn it if they don't feel like it. Same goes for other "language X is good for AI" type posts.
Java with orm might be easier actually. Also that middleware for microservices might be overkill (context filling)
I happen to just stumble across this article <a href="https://felixbarbalet.com/simple-made-inevitable-the-economics-of-language-choice-in-the-llm-era/" rel="nofollow">https://felixbarbalet.com/simple-made-inevitable-the-economi...</a> extolling the virtues of Clojure. It specifically calls out Go for not being simple in the ways that matter for LLMs.<p>I've no idea myself, I just thought it was interesting for comparison.
Is this your alt account?<p><a href="https://news.ycombinator.com/item?id=47222705">https://news.ycombinator.com/item?id=47222705</a><p>Edit: cool article, I have myself speculated that we will get a new language made for/by llms that will be torture writing by hand/ide but easy to read/follow/navigate/check for a human and super easy for Llms to develop and maintain.
TypeScript is what this author is looking for.<p>Golang just gets bogged down in irrelevant details way too easily for this.
Hi, author here, thanks! I have used TypeScript before across various projects, but I haven't considered building CLI tooling in that before, I guess due to my prejudice against the whole JS ecosystem. I plan to give it another try in the next weeks.
are you serious, hundreds of node_modules that I have no idea about, plus a runtime in the 100+ MBs alone.
As long as python runs all the models, the best language for agents is likely Python as it allows e.g. auto-fine-tuning of (local) LLMs for self-improving agents without the need to change the programming language. Use Pydantic if you care about type/runtime errors.
i have not used go for a while until claude code 4.5+, and yes it's the best language for AI coders.
> Joy and energy is one of the rarest resources a small team can have when building large projects<p>I really love this point-out. Not always an easy sell upstream, but a big factor in happy + productive teams.
I had a lot of success when having agents write D code. The results for me have been better than with C# or C++. I hadn't considered Go. Does anybody have some experience about how D fares vs. Go?
I haven't been amazed by the C# results that I have gotten either. I notice both GPT and Claude tend to write syntactically outdated C# code.<p>Though, I have found both to be better at C# than Swift, for example.
I find typescript pretty useful. As others pointed out the stricter the compile stage is, the better.<p>On the other hands if there good conventions it’s also a benefit, for example Ruby on Rails.
We won’t be reading much code in a year? Does that apply to every type of software?
you had me at Compile time bugs, strong typing, and static typing.<p>With Go it will increasingly become that one has to write the design doc carefully with constraints, for semi tech/coder folks it does make a lot of sense.<p>With Python, making believe is easy(seen it multiple times myself), but do you think that coding agent/LLM has to be quite malicious to put make believe logic in compile time lang compared with interpreted languages?
I happen to just stumble across this article <a href="https://felixbarbalet.com/simple-made-inevitable-the-economics-of-language-choice-in-the-llm-era/" rel="nofollow">https://felixbarbalet.com/simple-made-inevitable-the-economi...</a> extolling the virtues of Clojure. It specifically calls out Go for not being simple in the ways that matter for LLMs.<p>I've no idea myself, I just thought it was interesting for comparison.
Clojure is <i>definitely</i> dense. I’m wondering, though, about the languages’ representation in the training data.<p>Stack overflow tags:<p><pre><code> 17,775 Clojure
74,501 Go
</code></pre>
I’m not finding a way to get any useful information from GitHub, e.g. count of de-duplicated lines of code per language. There might be something in their annual “Octoverse” report but I haven’t drilled into it yet: <a href="https://github.blog/news-insights/octoverse/octoverse-a-new-developer-joins-github-every-second-as-ai-leads-typescript-to-1/" rel="nofollow">https://github.blog/news-insights/octoverse/octoverse-a-new-...</a>
I was prototyping to this end the other day - what would it be like for a coding agent to have access to a language that can be:<p>- structurally edited, ensuring syntactic validity at all times<p>- annotated with metadata, so that agents can annotate the code as they go and refer back to accreted knoweledge (something Clojure can do structurally using nodepaths or annotations directly in code)<p>- put into any environment you might like, e.g. using ClojureScript<p>I haven't proven to myself this is more useful/results in better code than just writing code "the normal way" with an agent, but it sure seems interesting.
Clojure is awesome for LLMs (if you shim in an automatic paren balancer).<p>But that's because it's tight, token efficient, and above all <i>local</i>. Pure functions don't require much context to reason about effectively.<p>However, you do miss the benefit of types, which are also good for LLMs.<p>The "ideal" LLM language would have the immutability and functional nature of Clojure combined with a solid type system.<p>Haskell or OCaml immediately come to mind, but I'm not sure how much the relative lack of training data hurts... curious if anyone has any experiences there.
Agents are language agnostic actually, I think "best" this "best" that is a little overboard.
For the go vs rust points in the article:<p>- I agree that go's syntax and concepts are simpler (esp when you write libraries, some rust code can get gnarly and take a lot of brain cycles to parse everything)<p>- > idiomatic way of writing code and simpler to understand for humans - eh, to some extent. I personally hate go's boilerplate of "if err != nil" but that's mainly my problem.<p>- compiles faster, no question about it<p>- more go code out there allowing models to generate better code in Go than Rust - eh, here I somewhat disagree. The quality of the code matters as well. That's why a lot of early python code was so bad. There just is <i>so</i> much bad python out there. I would say that code quality and correctness matters as well, and I'd bet there's more "production ready" (heh) rust code out there than go code.<p>- (go) it is an opinionated language - so is rust, in a lot of ways. There are a lot of things that make writing really bad rust code pretty hard. And you get lots of protections for foot meets gun type of situations. AFAIK in go you can still write locking code using channels. I don't think you can do that in rust.<p>- something I didn't see mentioned is error messages. I think rust errors are some of the best in the industry, and they are sooo useful to LLMs (I've noticed this ever since coding with gpt4 era models!)<p>I guess we'll have to wait and see. There will be a lot of code written by agents going forward, we'll be spoiled for choice.
Intuitively I expect this. Go is a language designed by Rob Pike to keep legions of high IQ Google engineers constrained down a simple path. There's generally one way to do it in Go.<p>As a human programmer with creative and aesthetic urges as well as being lazy and having an ego, I love expressive languages that let me describe what I want in a parsimonious fashion. ie As few lines of code as possible and no boilerplate.<p>With the advances in agent coding none of these concerns matter any more.<p>What matters most is can easily look at the code and understand the intent clearly. That the agent doesn't get distracted by formatting. That the code is relatively memory safe, type safe and avoids null issues and cannot ignore errors.<p>I dislike Go but I am a lot more likely to use it in this new world.
I independently came to this conclusion myself a few months ago. I don't particularly enjoy working with Go. I find it to be cumbersome and tedious to write by hand. I find the syntax to be just different enough from C++ or C# to be irritating. Don't get me started on the package versioning system.<p>But it does have the benefit of having a very strong "blessed way of doing things", so agents go off the rails less, and if claude is writing the code and endless "if err != nil" then the syntax bothers me less.
If code is now free, why does the language matter at all?
All code has bugs, the vector space of all possible bugs determines the entropy of the problem space for a large language model to traverse.<p>Reduce entropy, increase probability of the correct outcome.<p>LLMs are surfing higher dimensional vector spaces, reduce the vector space, get better results.
Because you'll have to review it, and Go's design limits the number of ways it can go wrong.<p>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 ...<p>... write the code yourself?
I 100% agree, and do, but it's an answer to the GP's question (why generated code language matters)<p>I think many many people just skip the "review" step in this process, and assume they're saving time. It's not going to end well.
Go's fast compile times (feedback) are good for dumb models. Smarter ones are more likely to get it right and can therefore use languages with richer type systems.
My experience is that AI agents are not that good with Go. Not sure why but I think it is down to the low code quality of many major open source projects in Go.
[flagged]
Strange article. Why is Go the best language for agents instead of, say, Python? Here are the points the author seems to make:<p>---<p># Author likes go<p>Ok, cool story bro...<p># Go is compiled<p>Nice, but Python also has syntax and type checking -- I don't typically have any more luck generating more strictly typed code with agents.<p># Go is simple<p>Sure. Python for a long time had a reputation as "pseudocode that runs", so the arguments about go being easy to read might be bias on the part of the author (see point 1).<p># Go is opinionated<p>Sure. Python also has standards for formatting code, running tests (<a href="https://docs.python.org/3/library/unittest.html" rel="nofollow">https://docs.python.org/3/library/unittest.html</a>), and has no need for building binaries.<p># Building cross-platform Go binaries is trivial<p>Is that a big deal if you don't need to build binaries at all?<p># Agents know Go<p>Agents seem to know python as well...<p>---<p>Author seems to fall short of supporting the claim that Go is better than any other language by any margin, mostly relying on the biases they have that Go is a superior language in general than, say, Python. There are arguments to be made about compiled versus interpreted, for example, but if you don't accept that Go is the best language of them all for every purpose, the argument falls flat.