Top
Best
New

Posted by khazit 12/7/2025

Go is portable, until it isn't(simpleobservability.com)
153 points | 132 commentspage 3
novoreorx 3 days ago|
This article reminds me of the days before LLMs ruled the world, when the word "agent" was most commonly used in the DevOps area, representing the program that ran on a remote machine to execute dispatched jobs or send metrics. Now I wonder how many developers would look at "agent" and think of this meaning.
trashburger 3 days ago||
Cross-compiling doesn't work because you're not defining your dependencies correctly and relying on the existence of things like system libraries and libc. Use `zig cc` with Go which will let you compile against a stub Glibc, or go all the way and use a hermetic build system (you should do this always anyhow).
daviddever23box 12/7/2025||
This is an (organizational) tooling problem, not a language problem - and is no less complicated when musl libc enters the discussion.
laladrik 12/7/2025|
The conclusion of the article says that it's not the language problem either. Under the title "So, is Go the problem?" Or do you mean something else here?
saghm 4 days ago||
Given that the title implies the opposite, I think it's a fair criticism. Pointing out clickbait might be tedious, but not more so than clickbait itself.
cosmin800 4 days ago||
Well, that was pretty obvious that the portability is gone, especially when you start linking into systemd, even on the host system you have to link with the shared libs into systemd, you cannot link statically.
cyberax 3 days ago||
Cgo is terrible, but if you just want some simple C calls from a library, you can use https://github.com/ebitengine/purego to generate the bindings.

It is a bit cursed, but works pretty well. I'm using it in my hardware-backed KMIP server to interface with PKCS11.

p0w3n3d 3 days ago||
Basically everything is portable unless it isn't. Java - the same. We fly in abstractions unless you need to delete a file
nurettin 3 days ago||
Go is portable until you have to deploy on AS/400
0xbadcafebee 3 days ago||
There's no such thing as a portable application; only programs limited enough to be lucky not to conflict with the vagaries of different systems.

That said, in my personal experience, the most portable programs tend to be written in either Perl or Shell. The former has a crap-ton of portability documentation and design influence, and the latter is designed to work from 40 year old machines up to today's. You can learn a lot by studying old things.

mbrumlow 3 days ago||
I really hate this type of blog. It pollutes the world with this attitude of “I messed up, how I have to frame the problem in a way, and write a blog that lets my ego stay intact”, which results in blogs like this showing in decision making process as “why you should not use go”. And mostly people never look past the title.

The fact is go is portable, it provides the ability to cross compile out of the box and reasonably executed on other platforms it supports. But in this case, a decision that had little to do with go, the desire to use c code, a non go project, with their go project made things harder.

These are not “just a set of constraints you only notice once you trip over them”, this is trivializing the mistake.

Entire blog can be simplified to the following.

We were ignorant, and then had to do a bunch of work because we were ignorant. It’s a common story in software. I don’t expect everybody to get it right the first time. But what we don’t need is sensational titled blogs full of fluff to try to reason readers out of concluding the obvious. Somebody in charge made decisions uninformed and as a result the project became more complicated and probably took longer.

thomashabets2 3 days ago|
The portability story for Go is awful. I've blogged about this before: https://blog.habets.se/2022/02/Go-programs-are-not-portable....

It's yet another example of Go authors just implementing the least-effort without even a slight thought to what it would mean down the line, creating a huge liability/debt forever in the language.

hu3 1 day ago|
You expect Go to magically make systemd journaling exist in macOS?

I can't even begin to comprehend the thought process here.

thomashabets2 1 day ago||
I can't even begin to comprehend how you got from here to there.

I encourage you to elaborate on how you think that's connected, and not make a strawman argument. You may have not done so deliberately, but if you can't begin to comprehend that I would mean what you said, then you could give me the benefit of doubt and maybe entertain the idea that I did not.

Edit: In my blog post I give the example of getpwnam_r. One should not check for if the OS is Solaris in a given version range, but if getpwnam_r is one or the other type.

hu3 17 hours ago||
No language is going to do that for you. And I don't think Go promissed otherwise.

Perhaps it's about managing expectations.

thomashabets2 14 hours ago||
I mean… my whole blog post is about how autotools does that easily, and Go does not.

"Language", no. But Go's build comments are not really part of the language proper.

More comments...