Live data from Hacker News

A case for Go as the best language for AI agents

getbruin.com

211–220 of 310 posts

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

#211
I love the simplicity & practicality of Go, but can't get over the limited type-system.

I love the expressivity of Rust, but compile times are a problem.

Someone with some sway, please convince a hyper-scalar to support something like https://borgo-lang.github.io/. I think it may be the AST that we all need.

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

#212
post #211

I love the simplicity & practicality of Go, but can't get over the limited type-system. I love the expressivity of Rust, but compile times are a problem. Someone with some sway, please convince a hyper-scalar to support something like https://borgo-lang.github.io/ . I think it may be the AST that we all need.

[deleted]

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

#213
post #43

Have yet to find a better choice than OCaml: - Strongly typed, including GADTs and various flavors of polymorphism, but not as inscrutable as Haskell - (Mostly) pure functions, but multiple imperative/OO escape hatches - The base language is surprisingly simple - Very fast to build/test (the bytecode target, at least) - Can target WASM/JS - All code in a file is always evaluated in order, which means it has to be def…

Seems like if you're in that boat you'd just want to go with F# though?

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

#214
post #35

Earlier quoted context omitted.

You can add a callback to e.g. Claude to guarantee it does a cargo check and test.

Fwiw i used to do this (and with lints) - it was the only way to make Claude consistent in the early days when i first started using it (~August 2025). For many months now though, Claude is nearly consistent with both calling test and check/clippy. Perhaps this is due to my global memory file, not sure to be honest. What i do know, is that i never use those hooks, i have them disabled atm. Why? Because the benefit is…

I find this doesn't work automatically for me because the projects I'm on have a lot of conditional compilation feature flags that it doesn't quite understand how to cargo check properly, unless I tell it.

Maybe for your case you could create a /maybe-check command, and run that in the hook? Then specify the conditions under which a check/test is needed in there.

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

#215

Earlier quoted context omitted.

Unit tests in the same file wastes context and makes the whole thing hard to navigate for humans and machines alike.

I’ve been doing the least amount of unit tests possible and doing debug asserts instead.

Normally I would put as many invariants in the types as possible, then tests cover the rest. I'm curious how you do this/what you use it for though. Would be cool if you had any examples.

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

#216

Earlier quoted context omitted.

Rust is unstable and slow to compile. I think these two features make it bad for LLMs and everything else.

Why do you say it's unstable?

It is literally being changed constantly. They chose to add it to the Linux kernel but they have to build the features they need into the language as they go. It's not backward compatible like C and C++ either. Sure, there are a couple of versions you could try to pin to in Rust, but then all your libraries need to be pinned to the same version (to be fair, this last part is an assumption).

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

#217
post #118
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…

Most of these reasons apply to Java as much, if not more. 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.

How are JVM startup times nowadays? Frankly the need to ship with a JVM (modulo graal admittedly) is a drawback, eg for CLI tools - which the author listed as a requirement. Go's static executable story, combined with it's competitive performance - without C++ or rust contortions - is a strong combo when your focus is on startup time and deployment simplicity. (If, otoh, I cared a lot about GC I'd definitely prefer Java - eg for non-fast algo trading.)

Java is a fine language, tech stack, and ecosystem, but I agree with the author and parent commenter that this is a sweet spot for Go. Their decision to use it makes a lot of sense.

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

#218

Earlier quoted context omitted.

Unit tests in the same file wastes context and makes the whole thing hard to navigate for humans and machines alike.

It’s about the best possible documentation.

It isn't documentation. It is example code, in the best case. That shit belongs in other files, not in the main file. There is also a reason why literate programming never took off in general. Good luck getting anything done when 80% (conservatively) of the stuff you have to scroll through contributes nothing to the actual execution of the program and might actually be giving you false impressions of how things need to be done.

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

#219

Earlier quoted context omitted.

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.

There are certainly humans with poor reasoning or even incapable of reasoning, I’m not sure what you think that proves?

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

#220
post #13

Earlier quoted context omitted.

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.

That matches with actual Rust use actually, I've worked with Rust since 2017 on multiple projects and the number of times I've used the lifetime annotation has been very limited. It's actually rare to have to borrow something and keep the borrow in another object (is where lifetime happens), most (95% at least I'd say) of the time you borrow something and then drop the borrow, or move the thing.

Yes, I basically do everything the lazy/thoughtless way for a first pass. I find in 99% of cases that's already performant enough and matches the intended data flow, but if you ever want to optimize it, you can. The same is also true with the types: you can bash out a prototype very quickly and then tighten them up later, using Clippy to easily find all the shortcuts you took.
Post reply on HN