Even though I run it full time now personally; I still think Linux has massive problems something like Windows or macOS don't have: app development. You can't target a thing, you have to target all the things and bloat your app like crazy so you might as well just ship a chromium based app because its practically the same thing anyway (shipping an entire userland because its not stable anyway)
If there were instead 10 viable and competitive desktop operating system with no clear leader, and macos and windows were there just among the others.. wouldn't you try to target as many as you can? Maybe we can think of linux itself as a microcosm of OSes we never got to have, and you have to target as many variants as you can in order for no dominant force to emerge. It ain't pretty but its what we have..
The part of the "microcosm" that prevents you from being able to easily compile a binary and have it run on a wide variety of distros doesn't have any upside I can see. The fact that you have to jump through hoops to target particular glibc symbol versions and that a stable OpenSSL ABI gets rug-pulled in new distro versions every few years aren't key to any benefits of distro/OS diversity. What would suffer if gcc/clang had a `--min-glibc-version=...` flag and OpenSSL settled on a long-term stable ABI subset for establishing TLS connections?
The way this all gets worked around is that people come up with stuff like Docker or Flatpak that ship their own copies of as many dependencies as possible. The disadvantage is that now I can't just patch an OpenSSL vulnerability by updating the system's copy of OpenSSL, the way Windows can for all software built on SChannel.
Have you heard of Cosmopolitan Libc? A single APE binary for every platform out there.
This is just not true. You can still write GTK2 or SDL apps, you just need to package your app for the target distro or open source it because it's an open-source-first ecosystem.
If you're looking for binary stability and to ship your app as a file, ELF is extremely stable. If your app accesses files, accesses the network through sockets, and use stable libraries like SDL or GTK it will work fine as a regular binary and be easy to ship. People just don't want to write their apps in C, when the operating system is designed for that.
Many native apps like Blender, Firefox, etc ship portable Linux x64 and arm64 binaries as tar gz files. This works fine. You can also use flatpak if you want automatic cross platform updates but yes, the format is unfortunately bloated.
It's not that easy to ship a JavaScript app on other OSes either and electron apps abound there too.
What does ELF being stable or people not writing apps in C have to do with Linux binary compatibility? No matter what language you use, it’s either dynamically linking to the distro’s libc or using Linux system calls directly.
Also, I recommend taking a gander at what the Linux build process/linking looks like for large apps that “just work” out of the box like Firefox or Chromium. There’s games they have to play just to get consistent glibc symbol versions, and basically anything graphics/GUI related has to do a bunch of `dlopen`s at runtime.
Flatpak and similar take a cop-out by bundling their own copies of glibc and other libraries, and then doing a bunch of hacks to get the system’s userspace graphics libraries to work inside the container.
thats been a solved problem for years with flatpak