Remix.run Logo
bensyverson an hour ago

Just use Go. LLMs have seen a ton of it, they write it well, it compiles practically instantly, and it has all the advantages of a typed compiled language.

I created a big Python codebase using AI, and the LLM constantly guesses arguments or dictionary formats wrong. Unit tests and stuff like pydantic help, but it's better to avoid that whole class of runtime errors altogether.

mbreese an hour ago | parent | next [-]

That’s what I’ve settled on. Python is so flexible that there are a million ways to organize code, pass arguments, etc. If you already have a code base to work from, an LLM can make new code in the style of the old code. But a fresh project? Once you get to a certain level of complexity it quickly can turn into write once, read never code (even if the code is passing tests).

This is where I’ve found that a compiled, strongly typed language (any one really) works well with an LLM. With the little bits of friction that is part of writing a language like Go, the LLM can produce pretty decent (and readable) code.

shepherdjerred 19 minutes ago | parent | prev | next [-]

Why use Go when you can use Rust?

Alejandro2026 18 minutes ago | parent [-]

why,i have same question

mountainriver 25 minutes ago | parent | prev | next [-]

Why? Go has a GC, is basically incompatible with C and very limited overall

Alejandro2026 14 minutes ago | parent [-]

Go's limited syntax is actually a feature here,because it stops the LLM from trying to be too clever

hirvi74 41 minutes ago | parent | prev | next [-]

But what is the selling point for Go? I get that it is allegedly hailed to be a simple language with basically no batteries included, but why is that a selling point? Does Go excel at anything no other language does?

pylotlight 19 minutes ago | parent | next [-]

Performance? Second only to rust and other lower level langs. Surely you don't need this spelled out for you...

nvader 13 minutes ago | parent [-]

Not just performance, but static typing and prevalent in the training data/easy for LLMs to reason about.

Of course, your response admits, "second to Rust", which I am guessing is an unspoken question in the grandparent's mind.

enneff 26 minutes ago | parent | prev | next [-]

For one thing it’s statically typed and has many fewer foot guns than Python, so the llm-produced code is more likely to do what you expect.

shepherdjerred 18 minutes ago | parent [-]

Go is statically typed but the type system leaves much to be desired.

Go’s benefit are primarily around simplicity, readability, and concurrency.

30 minutes ago | parent | prev | next [-]
[deleted]
chickenman_98 34 minutes ago | parent | prev [-]

I think that’s sort of the selling point no? It’s really boring. It has like -10 keywords, compiles insanely fast, and has a concurrency model that’s easy to use and read. LLMs are great at using Go tooling to sanity check along the way. It’s easy to write shitty Go but it’s really pleasant to work with if you find those things compelling.

khimaros 26 minutes ago | parent [-]

don't you worry about garbage collection?

camdenreslink 24 minutes ago | parent [-]

If you were using Python, then probably not.

23 minutes ago | parent | prev [-]
[deleted]