News for hackers. Stuff that matters.
Re:The Simplicity of Single-File Golang Deployments by drewg123 on Wednesday March 22, 2023 @10:43AM (#35261787)
The fact that it produces a single static binary is one of the nicest things about golang.

This used to be easy with C (on BSD & Linux) a long time ago, but then everything started to depend on various shared libs, who then depend on other libs, then things started to even dlopen libs behind your back so they didn't even show up in ldd, etc. Sigh.

Re:The Simplicity of Single-File Golang Deployments by traceroute66 on Wednesday March 22, 2023 @11:39AM (#35262756)
> The fact that it produces a single static binary is one of the nicest things about golang.

AND unlike Rust, Go has an eminently usable and comprehensive stdlib.

It means that for most projects you can just Get Stuff Done (TM) instead of deciding which of 24 "reinventing the wheel" Rust Crates you want to use for X, Y and Z functions of your Rust binary.

Re:The Simplicity of Single-File Golang Deployments by tptacek on Wednesday March 22, 2023 @12:09PM (#35263232)
Please don't start random language fights.
Re:The Simplicity of Single-File Golang Deployments by tomcam on Wednesday March 22, 2023 @12:42PM (#35263702)
Directly addressing the topic of a upvoted article is starting random language fights?
Re:The Simplicity of Single-File Golang Deployments by doodpants on Wednesday March 22, 2023 @01:08PM (#35264039)
The article is about Go, and while the article mentions other languages for comparison, Rust is not one of them. So traceroute66's comment comes across as starting a Rust vs. Go fight where not appropriate.
Re:The Simplicity of Single-File Golang Deployments by djbusby on Wednesday March 22, 2023 @01:14PM (#35264124)
Not even, they just expressing an opinion.
Re:The Simplicity of Single-File Golang Deployments by tomcam on Wednesday March 22, 2023 @04:47PM (#35266852)
Doesn’t come across as starting a fight to me. Not even close.
Re:The Simplicity of Single-File Golang Deployments by benatkin on Wednesday March 22, 2023 @05:34PM (#35267378)
Yeah the only thing is how you parse "eminently usable and comprehensive". The way I read it, it's not saying that Rust's isn't "eminently usable", but that it isn't both of those things. At most it's suggesting that a standard library can't be "eminently usable" if it isn't comprehensive IMO - perhaps it can be extremely usable but not eminently usable. It would be like saying a manual transmission on a car can't be "eminently usable".
Re:The Simplicity of Single-File Golang Deployments by AmpsterMan on Wednesday March 22, 2023 @08:59PM (#35269257)
I think the comparison is totally apt and illustrates why Rust and Go get compared very often. They are both languages that compile to a binary, rather than running in a managed environment.
Re:The Simplicity of Single-File Golang Deployments by vore on Wednesday March 22, 2023 @05:44PM (#35267482)
Where does the word Rust appear in the article?
Re:The Simplicity of Single-File Golang Deployments by LanceH on Wednesday March 22, 2023 @11:16PM (#35270133)
In the comments about every article including Go, generally.
Re:The Simplicity of Single-File Golang Deployments by nimih on Wednesday March 22, 2023 @11:35PM (#35270237)
I can't speak for Go-centric articles in general, but for this one in particular, the only one (as of now, after 14 hours of comments) bringing up Rust is this single person with (apparently) a weird chip on their shoulder.
Re:The Simplicity of Single-File Golang Deployments by benatkin on Wednesday March 22, 2023 @05:28PM (#35267321)
That's no language fight. Rust doesn't want batteries included. That's highlighting a difference between the languages.
Re:The Simplicity of Single-File Golang Deployments by earthling8118 on Wednesday March 22, 2023 @12:09PM (#35263234)
From another point of view "usable" isn't a word I'd associate with Go, especially not when there is an "unlike Rust" in the phrase. I've not had any issues of the sort when building out Rust applications. At this point the only time I touch Go is if I need to modify something else someone has made-- which I avoid at all costs
Re:The Simplicity of Single-File Golang Deployments by aatd86 on Wednesday March 22, 2023 @06:31PM (#35267934)
Maybe AI will make it more palatable but I just can't get into Rust.

I can probably easily understand borrowing. It's mostly an issue of controlling pointer aliasing wrt mutability, especially in a multithreaded context I guess.

But that gottdarn syntax... And goroutines are too nice for the type of code I use.

I'm too spoiled with Go I guess.

Re:The Simplicity of Single-File Golang Deployments by brigadier132 on Wednesday March 22, 2023 @12:43PM (#35263710)
Using a crate is the opposite if reinventing the wheel. Also are we talking about go? The language without a set implementation?
Re:The Simplicity of Single-File Golang Deployments by asalahli on Wednesday March 22, 2023 @05:39PM (#35267432)
Parent is saying those crates themselves are reinventing the wheel, not talking about using a crate
Re:The Simplicity of Single-File Golang Deployments by brigadier132 on Wednesday March 22, 2023 @05:59PM (#35267641)
So by that logic Golang reinvented the wheel by creating a new programming language when java already existed
Re:The Simplicity of Single-File Golang Deployments by asalahli on Thursday March 23, 2023 @08:14PM (#35283369)
Yes. Is reinventing the wheel always a bad thing, though? Not if you ask me, not if the new wheel has novel characteristics and performs better in some aspects.
Re:The Simplicity of Single-File Golang Deployments by pjmlp on Wednesday March 22, 2023 @12:46PM (#35263751)
If only they would decide what to do with plugin package, not use SCM paths for packages and decide to eventually support enumerations instead of iota dance (Pascal style would be enough.

Maybe 10 more years.

Re:The Simplicity of Single-File Golang Deployments by Joker_vD on Wednesday March 22, 2023 @01:22PM (#35264226)

    type Kind enum {
        Simple,
        Complex,
        Emacs,
    }

    const kindStrings [Kind]string = {
        "simple",
        "complex",
        "emacs",
    }

    func (k Kind) String() string {
        return kindStrings[k]
    }

    func t() {
        var a = Kind.Emacs - Kind.Simple  // a has type int and value 2
        var b = Kind.Simple + Kind.Emacs  // type error
        var c = Kind.Simple + 1           // type error
        var d = len(Kind)                 // d has type int and value 3

        for k := range Kind {
            fmt.Printf("%v\n", k) // prints what you expect it to do
        }

        // not sure about legality or runtime behaviour of the followng
        var t = Kind.Emacs
        t++
        t = Kind(42)        
    }
Would be nice, not gonna lie.
Re:The Simplicity of Single-File Golang Deployments by randomdata on Wednesday March 22, 2023 @10:25PM (#35269741)
How is this any different than Go's existing enumerations, aside from the enumeration also creating an implicit list structure which, while kind of neat, isn't really a property of enumerations.

The parent is likely lamenting that Go doesn't enforce compile-time value constraints on enumerated sets like some languages do, but many other languages don't ether. Not even Typescript does. If Typescript doesn't find it important to have such value constraints, Go most certainly never will.

Re:The Simplicity of Single-File Golang Deployments by Joker_vD on Thursday March 23, 2023 @06:11AM (#35272428)
> Go's existing enumerations

Go doesn't have enumerations. So the first difference would be that my enums would actually exist.

> implicit list structure which, while kind of neat, isn't really a property of enumerations

It absolutely is, or people wouldn't have been regularly writing enums like

    typedef Kind enum {
        KindSimple,
        KindComplex,
        KindEmacs,
        Kind_NUM_VALUES
    };
which they do about half the time.

> likely lamenting that Go doesn't enforce compile-time value constraints

Yes, that's my complaint as well. Which is why that "not sure about legality" part in my example: you want to be able to enumerate the enum (duh), but with last_value_of_enum++ being illegal, writing for-loop with "<" is illegal too, that's why there is support for it in for-range.

With incrementing (used in loops almost exclusively) taken care of, the rest of arithmetics on enums is meaningless in general except maybe in case of subtraction (when you use enums as keys/indices for a fixed-sized array) which is why I allow it — but it produces an int, of course.

As for what should happen in Kind(42) example — perhaps it could work like type-assertions?

    k, err := Kind(42)
    if err != nil {
        return err
    }
Re:The Simplicity of Single-File Golang Deployments by randomdata on Thursday March 23, 2023 @08:16AM (#35273522)
> Go doesn't have enumerations. So the first difference would be that my enums would actually exist.

That's obviously not true. That's what the iota dance is for.

    type Kind int

    const (
        KindSimple Kind = iota
        KindComplex
        KindEmacs
        Kind_NUM_VALUES   
    )
Go doesn't have a literal enum keyword, if that's what you mean, but enumerations aren't defined by having a specific keyword or specific syntax. Enumerations are a more general concept, defined as a set of named constants. The above is functionally identical to your example in C, among a host of other languages.

> Yes, that's my complaint as well.

Fine, but that's not a property of enumerations. If one wants support for value constraints, surely one should ask for that and not for something the language has had since the beginning?

Re:The Simplicity of Single-File Golang Deployments by Joker_vD on Thursday March 23, 2023 @09:59AM (#35274909)
Mmm. The original comment asked for "Pascal-style enums". Those are different from C enums: they are incompatible with integers and other enums, they don't support arithmetic operations (you have to use succ()/pred() built-ins) and they contain precisely the named values. Plus, enums being ordinal types, you could use them as array indices in type definitions, like "array[Kind] of real".

So that's what I went with, because I actually liked Pascal-style enums but thought they could be somewhat improved, so what you've read is my ideas (Go is surprisingly close to Oberon and both lack enums).

Re:The Simplicity of Single-File Golang Deployments by randomdata on Thursday March 23, 2023 @10:57AM (#35275812)
The original comment asked for enumerations. Despite him not realizing, Go has those. It has a relatively unique syntax for defining enums, sure, but enumerations are not defined by specific syntax. They are a higher level concept that transcends any specific syntax implementation.

The original comment also hinted at wanting other features that some other languages have, including Pascal, although not stating which features specifically. I expect he was referring to wanting some kind of constraint system, which is the most common feature I hear requested of Go. But that's beyond the scope of enumerations.

Re:The Simplicity of Single-File Golang Deployments by p5v on Wednesday March 22, 2023 @05:29PM (#35267340)
Regarding the “iota dance,” I wrote my 2 cents on what could be a slightly more robust approach a couple of days ago: https://preslav.me/2023/03/17/create-robust-enums-in-golang/

P.S generic type sets make it even better. I’ll write an update to my post these days.

Re:The Simplicity of Single-File Golang Deployments by Asdrubalini on Wednesday March 22, 2023 @01:20PM (#35264197)
Rust's philosophy (unlike Python's, for example) consists in not including tons of stuff in the standard library, this way you can choose the best implementation for your specific use case from one of the many crates (which are super easy to install, by the way). There is no "always the best" implementation for a specific functionality, nor a legacy-but-still-officially-supported-in-std implementation that nobody uses anymore but still needs to be maintained with its own namespace.

I don't see this as negative or "reinventing the wheel". Reinventing the wheel would be writing your own implementation, which doesn't happen if you can choose from many high-quality crates.

Re:The Simplicity of Single-File Golang Deployments by abtinf on Wednesday March 22, 2023 @02:01PM (#35264796)
> legacy-but-still-officially-supported-in-std implementation

There is massive value in this.

Re:The Simplicity of Single-File Golang Deployments by Asdrubalini on Wednesday March 22, 2023 @04:50PM (#35266902)
Not officially supported doesn't mean not updated or not supported in general.
Re:The Simplicity of Single-File Golang Deployments by lenkite on Wednesday March 22, 2023 @03:11PM (#35265801)
"a legacy-but-still-officially-supported-in-std implementation that nobody uses anymore but still needs to be maintained with its own namespace."

The cardinality of the set of "nobody uses anymore" is usually in tens of millions.

Re:The Simplicity of Single-File Golang Deployments by Asdrubalini on Wednesday March 22, 2023 @04:51PM (#35266923)
If something is used by tens of millions, be sure that it will be updated even if legacy. Just not officially by the people who maintain the language.
Re:The Simplicity of Single-File Golang Deployments by apazzolini on Wednesday March 22, 2023 @07:28PM (#35268505)
Ah yes, the #1 thing golang is known for: a comprehensive stdlib. Like including a max function for integers, right?
Re:The Simplicity of Single-File Golang Deployments by BreakfastB0b on Thursday March 23, 2023 @06:20AM (#35272488)
That attitude assumes that the go standard library is the global maximum for Getting Stuff Done, and because of backwards compatibility guarantees ensures that it’s difficult to innovate on.

I think having a small standard library is actually a good thing because it encourages exploration of the space of possibilities.

For example Go’s stdlib http.HandlerFunc sucks, people instead opt for leaving it behind entirely in favour of Gin or trying to work around it with bad patterns like interface smuggling.

Re:The Simplicity of Single-File Golang Deployments by candiddevmike on Wednesday March 22, 2023 @11:17AM (#35262341)
From what I have seen in major OSS projects like systemd and PostgreSQL, nothing seems to support static linking, to the point where some contributors get annoyed when you ask for it.

Seems like the C/C++ ecosystem will stay dynamically linked, even with a lot of the industry shifting towards statically linked, fat binaries as disk space is pretty cheap.

I wonder how much simpler Linux packaging would be if everything was statically linked...

Re:The Simplicity of Single-File Golang Deployments by bzzzt on Wednesday March 22, 2023 @11:39AM (#35262767)
Packaging would be simpler, but you probably have to update the whole OS and all your installed apps when a security update for a common library is released.
Re:The Simplicity of Single-File Golang Deployments by taeric on Wednesday March 22, 2023 @12:31PM (#35263533)
Not wrong; at the same time, I'm becoming less convinced this is relevant. Seems many security updates have to do with code paths that are not used in a large number of applications. Similarly, many of them are fixes on features that even more apps didn't want/need, but they got when they updated to get the last round of security fixes. :(

The docker world is a neat example of this. The stories of ${absurdly high percent} of containers having vulnerabilities only gets to claim that because of "unpatched libraries." If you reduce it to the number of containers with exploitable vulnerabilities, it is still non-zero, but not nearly as high.

Re:The Simplicity of Single-File Golang Deployments by nightfly on Wednesday March 22, 2023 @05:44PM (#35267477)
The problem is having to wait for all those applications to push updates when a vulnerability is found in a common library
Re:The Simplicity of Single-File Golang Deployments by taeric on Wednesday March 22, 2023 @08:04PM (#35268813)
That is the thing, though. For most applications, those vulnerabilities in a common library are not relevant. That is what I was talking about in saying that it is in code that isn't used by them.

You are, of course, right that it has the possibility of happening. But by and large, it doesn't happen there any more often than it does in the dynamically linked cases. And, by and large, the dynamically linked cases are often a lot more complicated to deploy. (Granted, deployment for either should be doable nowadays.)

The dream, of course, is you just patch the library and call it a day. The reality seems to usually be a circus check on every application that you have deployed to see if they are impacted anyway.

Re:The Simplicity of Single-File Golang Deployments by initplus on Wednesday March 22, 2023 @09:47PM (#35269508)
The solution to this is to make the build process as simple as possible. Then pushing updates has a much lower maintenance cost.

I can be confident I will be able to build >90% of go programs by cloning the repo and calling go build.

Re:The Simplicity of Single-File Golang Deployments by rangerelf on Wednesday March 22, 2023 @11:58AM (#35263071)
Simpler but small updates, like say openssl, become massive distro updates. There's a reason why everyone went with shared libs when they became stable.
Re:The Simplicity of Single-File Golang Deployments by iambvk on Wednesday March 22, 2023 @12:54PM (#35263852)
A system with shared libraries also needs an update for the security fixes. There is no avoiding the update step. However, the only difference is the size of the update. If update process is robust, size of the update shouldn't matter, isn't it?
Re:The Simplicity of Single-File Golang Deployments by dahfizz on Wednesday March 22, 2023 @05:50PM (#35267547)
It does matter. If there is a problem with openssl, just the openssl maintainers have to push an update and everything on your system is secure.

If everything is statically linked, you need to wait for every maintainer of every single program on your system to rebuild and push an update. You're basically guaranteed that there is always _something_ missing important patches

Re:The Simplicity of Single-File Golang Deployments by fdeee on Wednesday March 22, 2023 @08:18PM (#35268936)
The matter isn't the binary size of the update. It is the size of the crowd of people and parties involved in the update: For a bunch of statically linked applications, you need to involve all the application people/vendors. For a bunch of dynamically linked applications depending on a shared library, you (ideally) just need to involve the one library's people/vendor.

And "involve" might mean: wait for a bunch of unresponsive external parties to produce a new binary each for a security issue they might not care about. Of course on very different timelines, etc.

Re:The Simplicity of Single-File Golang Deployments by rvense on Wednesday March 22, 2023 @12:16PM (#35263345)
Docker images are static linking for the modern era.
Re:The Simplicity of Single-File Golang Deployments by jamesfinlayson on Wednesday March 22, 2023 @07:50PM (#35268692)
Funnily enough I was looking at an issue in my one of personal projects last night about asking me to statically link libstdc++ - it's something I was interested in doing because I spent way too long spinning my wheels on an issue caused by loading an outdated libstdc++.so.6, but I read that statically linking can cause issues if your code loads another library that dynamically links libstdc++... which I'm pretty sure my project does (it's a pass-through between an executable and another library). So I want to, but it sounds like if I do it might work but be fragile at best.
Re:The Simplicity of Single-File Golang Deployments by quaintdev on Wednesday March 22, 2023 @11:23AM (#35262461)
> The fact that it produces a single static binary is one of the nicest things about golang.

Not only that it can also cross compile for different architecture and operating systems.

Re:The Simplicity of Single-File Golang Deployments by adql on Wednesday March 22, 2023 @12:10PM (#35263257)
We used that to make a simple "VPN diagnostics" app for our helpdesk (app checked connectivity and config of the machine then displayed the summary page). Only thing that needed to be written per-os is how to call a browser to display the report
Re:The Simplicity of Single-File Golang Deployments by sconi on Wednesday March 22, 2023 @01:40PM (#35264475)
interesting. could you share what specifically the report had?
Re:The Simplicity of Single-File Golang Deployments by lagniappe on Wednesday March 22, 2023 @03:34PM (#35266052)
I made a cool program for Go projects that will compile all the supported OS and ARCH combos for your code. Please try it :) I use it for everything I make now.

Just do `release --name "mycoolprogram" --version "0.1.0"`

and it will output all of your labeled release binaries for every platform your code supports.

check it out! [0] You can see it at work here for this simple markdown blog generator I made, which sports 40 different platform combos [1]

[0] - https://github.com/donuts-are-good/release.sh

[1] - https://github.com/donuts-are-good/bearclaw/releases/latest

Re:The Simplicity of Single-File Golang Deployments by superb-owl on Wednesday March 22, 2023 @09:24PM (#35269388)
looks a heck of a lot simpler than goreleaser! I love goreleaser but it gets outrageously complicated.
Re:The Simplicity of Single-File Golang Deployments by lagniappe on Wednesday March 22, 2023 @09:30PM (#35269435)
Thanks for checking it out :) I'm not going to pretend I haven't been refreshing the page waiting for bugs and comments
Re:The Simplicity of Single-File Golang Deployments by cjdoc29 on Wednesday March 22, 2023 @08:14PM (#35268900)
So I always assumed this was the case for other compiled languages. Is this something special in Golang and/or recently created languages?
Re:The Simplicity of Single-File Golang Deployments by teraflop on Wednesday March 22, 2023 @08:51PM (#35269193)
I think the main thing that's different about Go compared to more old-school languages is that the Go binary distribution includes the cross-compilers right out of the box. So anybody who can run "go build" can also cross-compile their application -- and, importantly, all of its library dependencies -- for any architecture that Go supports.

On the other hand, if you want to cross-compile a C program using GCC, you need to separately build and install a complete gcc+binutils toolchain for every individual arch that you want to target. And you have to handle the dependency management yourself, which may be tricky if your dependencies' build scripts weren't designed with cross-compilation in mind.

Re:The Simplicity of Single-File Golang Deployments by throwawaymaths on Wednesday March 22, 2023 @09:12PM (#35269331)
No. Some bytecode compiled languages are compiled and require at least an archive to be unzipped or at least the virtual machine pre installed.

Java is an example -- you'll want your your system java deployment to match the stuff stashed in your jar.

Erlang is compiled but usually releases bundle the VM up with the project, so you typically deliver a full directory with the VM packed in there.

Re:The Simplicity of Single-File Golang Deployments by heleninboodler on Thursday March 23, 2023 @01:25PM (#35278156)
On top of this, with java, the jvm is itself dynamically linked to libc most of the time.
Re:The Simplicity of Single-File Golang Deployments by nu11ptr on Wednesday March 22, 2023 @09:27PM (#35269409)
Golang is special because pure Go programs tend to have a closed ecosystem with its own linker (that typically don't link to libc or other C libs) so it makes static linking very easy. Other languages can certainly do static linking, but it tends to be a bit challenging to set it up on different OS's due to the need to have all needed C libs as static libs and then instruct the linker appropriately.
Re:The Simplicity of Single-File Golang Deployments by heleninboodler on Wednesday March 22, 2023 @10:41PM (#35269876)
Not dynamically linking to libc is pretty unusual. The libc-equivalent parts are in the Go runtime, statically linked.
Re:The Simplicity of Single-File Golang Deployments by synergy20 on Wednesday March 22, 2023 @11:09AM (#35262211)
very true, for Go though if you need CGO it's hard to make a single executable, otherwise it is great.

I run a few Go apps, all are single executables, upgrading to new releases has never been easier.

if you have a network oriented application, nothing beats golang as far as release|maintenance is concerned.

Re:The Simplicity of Single-File Golang Deployments by dilyevsky on Wednesday March 22, 2023 @05:07PM (#35267095)
> CGO_ENABLED=1 CC=musl-gcc go build --ldflags '-linkmode external -extldflags=-static'

Unless you cant use musl for some reason, but that’s a glibc problem, not Go

Re:The Simplicity of Single-File Golang Deployments by aatd86 on Wednesday March 22, 2023 @06:34PM (#35267962)
Some people are writing alternative via WebAssembly.

For instance wazero which I'm really excited about.

https://tetrate.io/blog/introducing-wazero-from-tetrate/?utm...

Re:The Simplicity of Single-File Golang Deployments by cookiengineer on Thursday March 23, 2023 @12:48AM (#35270656)
In the malware reverse engineering scene, there are a lot of forks of the upstream "debug" go library, because it allows loading, parsing, compiling and executing libraries from disk (rather than in-kernel or in-userspace) because it is independent of dlopen.

And there's also "purego" as an implementation that directly generates shellcode.

Maybe those will help you, too?

I am just mentioning these because for my use cases those approaches worked perfectly, CGO free.

[1] https://github.com/Binject/debug

[2] https://github.com/ebitengine/purego

Re:The Simplicity of Single-File Golang Deployments by synergy20 on Thursday March 23, 2023 @01:08AM (#35270733)
very useful,thanks
Re:The Simplicity of Single-File Golang Deployments by shp0ngle on Wednesday March 22, 2023 @11:49AM (#35262930)
You can still do that with musl, can’t you? Can make a static c binary with that
Re:The Simplicity of Single-File Golang Deployments by 1vuio0pswjnm7 on Wednesday March 22, 2023 @06:26PM (#35267879)
IME, using musl, compiling static binaries written in C is as easy as it was before glibc changes and as it has always has been on NetBSD. I compile static binaries written in C every day on Linux. I never encountered any problems compiling static binaries on BSD.
Re:The Simplicity of Single-File Golang Deployments by nneonneo on Wednesday March 22, 2023 @07:47PM (#35268669)
That’s great if your only dependency is libc. It gets progressively harder the more dependencies you need, and it becomes downright untenable the moment you run into some dependency with a dlopen-based plugin architecture.
Re:The Simplicity of Single-File Golang Deployments by drewg123 on Wednesday March 22, 2023 @07:51PM (#35268707)
Can you link something substantial, like Firefox, statically on NetBSD?
Re:The Simplicity of Single-File Golang Deployments by 1vuio0pswjnm7 on Wednesday March 22, 2023 @08:19PM (#35268949)
Compiling Firefox on NetBSD (dynamically) takes longer than compiling the kernel, maybe even longer than compiling an entire base system. It's been a long time since I tried it but it just took far too long so I lost interest. Granted, the computers I use have limited resources. Anyway, I gave up on graphical browsers many years ago. There are many programs I can compile statically because I prefer smaller software.^1 For example, the text-only browser, the TCP clients, the forward proxy, tmux, tinysshd, nvi, lua, stunnel, djbdns, daemontools, clockspeed, openssl, bssl, ffmpeg and various other programs I use are all static binaries. I also prefer crunched binaries on BSD to save space. These are static.

Whether a program can be compiled statically is a factor in whether I choose to use it. That effectively screens out many large programs that have numerous dependencies because compiling them statically often becomes too much hassle and the binaries are too large. For example, I compiled dnsdist statically using musl. Of course, "large" is subjective. I consider an 11M C program to be large but some HN commenters using memory-safe languages might think 11M is nothing.

1. Some have dependencies other than libc.

Re:The Simplicity of Single-File Golang Deployments by 1vuio0pswjnm7 on Wednesday March 22, 2023 @11:26PM (#35270198)
Graphical web browsers from "tech" companies are too large, too complex, too difficult for the user to control. IMHO.
Re:The Simplicity of Single-File Golang Deployments by 1vuio0pswjnm7 on Thursday March 23, 2023 @06:02PM (#35281908)
If "you" means "a person", then yes.

If "you" means me, then no, because I do not have the patience nor do I think it would be worth the trouble.

The binary would be enormous.

One thing I used to do many years ago is create compressed images of directories containing programs or files needed by those programs, e.g., /usr/pkg/bin, etc., using makefs and vndcompress, then save these to bootable USB stick. For example, I might install Firefox, then create the images. The way I use NetBSD is that I boot into RAM from USB. I may or may not use a disk. Writeable directories are mounted as tmpfs. I use RAM as disk. This is one reason I like small programs. Installing Firefox would take up too much space, i.e., RAM, so I would mount the USB stick after boot, then mount the compressed images over certain directories, e.g., /usr/pkg/bin. As I recall, this worked, but eventually I gave up on graphical browsers, as well as X11.

Re:The Simplicity of Single-File Golang Deployments by 1vuio0pswjnm7 on Wednesday March 22, 2023 @10:02PM (#35269611)
Many of the static binaries I use rely on dependencies other than libc. Most are small programs. Out of personal preference, I generally try to avoid large programs with numerous dependencies. Exception might be something like ffmpeg. Static binary for the author is 21M but package from repository is 84M so the static binary uses less space. ffmpeg has many dependencies besides libc.
Re:The Simplicity of Single-File Golang Deployments by caeril on Thursday March 23, 2023 @10:35AM (#35275474)
This is generally only true with CGO_ENABLED=0.

I've found many times that a go binary, even if it has no cgo or cgo dependencies, will randomly require glibc on the target system to execute if you don't explicitly disable cgo in your build.