Live data from Hacker News

A case for Go as the best language for AI agents

getbruin.com

181–190 of 310 posts

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

#182
Is Go the best programming language for AI agents? I don't think so.

But what makes Go useful is the fact that it compiles to an actual executable you can easily ship anywhere - and that is actually really good considering that the language itself is super easy to learn.

I've recently started building some A agent tools with it and so far the experience has been great:

https://github.com/pantalk/pantalk https://github.com/mcpshim/mcpshim

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

#183

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?

There's a lot of language for such a little time, but if you have programmed any Forth it should be easy to pick up, have a look at some of the top level examples.

I have programmed about 3 Forth implementations by hand throughout the years for fun, but I have never been able to really program in it, because the stack wrangling confuses me enormously.

So for me anything vaguely complex is unreadable , but apparently not for the LLMs, which I find surprising. When I have interrogated them they say they like the lack of syntax more than the stack ops hamper them, but it might be just an hallucinated impression.

When they write Cairn I sometimes see stack related error messages scroll by, but they always correct them quickly before they stop.

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

#184
post #132
post #118

Earlier quoted context omitted.

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.

Certainly not the "one way to write it" idea. Java has a ton of language features.

Not really. It has a pretty bare bones OOP (single inheritance, interface), primitives and objects, generics and pretty much that's it.

Newer features fit very nicely and didn't increase the language surface (records are just a normal class with some methods auto-generated, while sealed types are just a restriction on who can subtype an interface -- and yet these give full ADT support for the language that improves readability and type safety).

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

#185
post #125
post #118

Earlier quoted context omitted.

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.

Except that Go is a simpler, smaller language than Java. That's one of the key points in the post.

More simplistic, not really simpler.

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

#187
post #122
post #118

Earlier quoted context omitted.

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.

I wonder what people will say to that. I personally think neither Go nor Java would be good for "agents". Better to have them sandboxed in WASM.

Sandboxing is a completely orthogonal issue and WASM is probably not a good direct target for LLMs.

Of course writing a language that compiles to Wasm is certainly a way, but you would have to sandbox also all the other tools that is used during development (e.g. agents can just call grep/find/etc).

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

#188
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…

[flagged]

LLMs are great with Typescript. But the fact remains that there are many different browsers and several runtimes (Node, Deno, Bun), each of which may have slightly different rules.

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

#189

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

[flagged]
Post reply on HN