You can create static binaries that bundle the python interpreter and dependencies.
You can do it with C. Or Csharp. Or many other programming languages. It’s not a feature unique to Go, it’s just that Go can only create static binaries.
Comment on It's me again. My Kubernetes devolver has reached the astral plane.
androidul@lemmy.world 14 hours agoWould’ve written a Golang program and spit-out a binary for everyone to execute on any machine
You can create static binaries that bundle the python interpreter and dependencies.
You can do it with C. Or Csharp. Or many other programming languages. It’s not a feature unique to Go, it’s just that Go can only create static binaries.
not only, you can go ahead and run a Go program as is, without compiling as well 😆
TIL about the one file, 10x for sharing, can you guarantee that runs everywhere?
go run works by compiling the program to a temporary executable and then executing that.
can you guarantee that runs everywhere
It seems to depend on glibc versions, if that’s what you are asking. You can force it to be more static by using a static musl python or via other tools. Of course, a binary for Linux only runs on Linux and the same for Windows and Mac. But yeah.
Also it should be noted that go binaries that use C library dependencies are not truly standalone, often depending on glibc in similar ways. Of course, same as pyinstaller, you can use musl to make it more static.
possiblylinux127@lemmy.zip 8 hours ago
You sweet summer child…