The Super Duper Universal Binary
tenfourfox.blogspot.com
tenfourfox.blogspot.com
Wouldn't that only work if the shim itself was a universal/fat binary? Otherwise you still run into the same problem. You can sort of work around on unix-like systems by using the shebang, and on windows by having the executable in .net.
In the average application, the binary is only a minor contributor to bundle size, assets are the vast majority of it.
For instance on my system Delicious Library 3 is a 110MB bundle. The binary is under 4MB. Same observation with Keka (30MB / 344K), xACT (15MB / 960K) or unicode checker (10MB / 500K)
Fat binaries were not an issue during the last transition, they're even less so now.
That was a big deal for Apple during their two previous transitions, but not as much these days where as I understand it a significant portion of Mac software distribution happens through the official App Store platform.
We see the same in the Linux world, where fat binary support has been developed and proposed on multiple occasions but has never really caught on because the number of users who don't know their CPU architecture but want to install software from outside their distro's package manager is effectively negligible.
It's not that significant. I'd guess the amount that goes through the app store is almost certainly less than half, and very possibly much less.
- to restore your apps onto a new machine using Migration Assistant and have them "just work" at full performance
- to have a single app that you can drag and drop install on your old and new hardware
- in campus environments to have a single image and archive for all local software
Figuring out how to get users to download the correct binary, now that sucks. Do you add JavaScript to your download page or do server-side sniffing with the user agent to deliver the correct binary? And do you want to explain to someone that yes, they downloaded the Mac version but they have an x86 Mac and can’t download the ARM binary?
Can't you detect the system architecture through the user agent string? eg. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Us.... I guess it's still an issue if you're downloading for ARM mac, using a x86 mac, but that's a pretty rare occurrence and you can work around it by allowing users to select the architecture manually.
Also from my experience, people still share downloaded copies of applications.
We can use thin binaries only when necessary—web browsers, for example.
The copy of TextEdit on my Mac is 6.8 MB, but the actual binary is only 167 KB. Even if you were to go nuts and compile a full-on 17-architecture version of the TextEdit binary, it would still constitute less than half the size of the app, and this is for TextEdit, an app with exceedingly few graphics.
And, we're talking exclusively about hard disk space—it's not as though the foreign architectures are getting loaded into memory and taking up space there. I'm all about sweating the details when it comes to optimization and performance, but even on a smaller SSD, a couple extra megabytes per app just isn't going to have a real impact.
Fun fact: many of the binaries in Snow Leopard are still PPC-Intel universal binaries, even through 10.6.8. The extra space used was so minimal that Apple didn't bother to fully strip out the PPC portions until Lion. (Early versions of Snow Leopard can even be booted on PPC by replacing certain files: https://forums.macrumors.com/threads/snow-leopard-on-unsuppo...)
A self-stripping binary sounds like a really interesting programming challenge, though.
Then a year later the user gets a new computer and migrates everything to it using Migration Assistant. The platform specific binary he downloaded from your website no longer runs, and he assumes it’s because it’s broken, or the new computer has a new OS, or he has to buy a new copy for the new computer.
Another potential problem would lie in a user copying an app to a second computer with a different architecture.
Lots of reasons to distribute fat binaries if you’re not in the App Store (n which case the OS can/will auto download the correct version upon migration).
Your thinking is way too complex. Apple's #1 resource is smooth UX and having different versions of an app that you need background knowledge about your computer to choose is very not smooth.
Might not be so relevant today for Windows, as I guess it's been a while since 32-bit Windows was popular. But the point stands, that during times when there are multiple versions in popular use, as will soon be the case for the Mac platform, asking the user to choose which they have is confusing, as they might not know.
Being able to download a single binary and it "just works" is exactly the user-interface for a download page that you want.
The advantage is convenience for the user (and developers), one download that works transparently for all computers.
I used to have a special shell script that I wrote, that used lipo to combine multiple binaries into an aggregate library. I probably still have it around, somewhere. I was fairly proud of it.
Also, I had to use static libs, which wasn’t a problem, as long as I didn’t mind a big executable that couldn’t be trimmed.
Over the years, I’ve learned (the hard way, since I’m a stubborn knucklehead) not to “end run” around Apple’s prescribed methodology.
Now that Apple has wrapped Swift Package Manager into Xcode, it lessens the need for “clumped” binaries (for internal projects).
Perfect command name. ;-)
Obviously that's not the case for all Java software, but has always amazed me how seemingly easy Java made it to end up like that. So many legacy Java apps that are a complete pain to support, and $deity help you if one user needs to run two different legacy apps with non-overlapping JRE requirements.
And that's not even getting in to the horrors that were the Java plugin, fortunately that is entirely out of my life and gone for good.
Sane support for different JREs is one of the use cases where containerization would really show its worth I expect. It should be relatively easy to set up a container with the app, the right jre version and a consistent set of dependency jars, all wrapped up with a shellscript that sets the class path and adds any horrible monkey patches you need to get things working and then launches it with the right set of arguments etc. Once that's done all that nastiness would be kept in its own private hell and you could have multiple of them running simultaneously and know that they won't infect each other and upgrading any one piece and/or your system jdk isn't going to kill everything.
It's not dependent on the system or user classpath or other environment variables, so should be reproducible and avoid weird "it works for me" bugs where the user is suffering something you just don't see.
Safe to say that's far from what "write once, run everywhere" seems to promise.
I just ran into this on a new machine while trying to get Bamboo (Atlassian's CI product) running. Just download latest? phhhttt It needs a specific version: 1.8. Wait a minute, WTF? Java is at like v14 now, or something, right? Ah, because apparently there's some soft link from 1.8 to $WHATEVER_VERSION. Didn't matter because I downloaded the JRE, but needed the JDK. Or something. I've eventually got it working, and wrote it down this time.
I go back so far that I've written software on punch cards. And someone suggests that we foist this on your average Mac (or for that matter, any OS) user? Fat binaries, please.
There was a compatibility break between Java 1.8 and Java 9 (the version number also lost the prefix at the same time, Java 1.8 can be thought of as "Java 8"). It was not as big as the change from Python 2 to Python 3, but a lot of software needed changes to not break; as late as last year, I was still seeing Java libraries adding fixes for compatibility with Java 9. If your software depends on libraries which have not yet been upgraded to work with Java 9, you have to require Java 8 (that is, Java 1.8).
It doesn't help that, even today, the default version of Java in some major Linux distributions is Java 1.8, so not only that's a good reason to keep compatibility with Java 8, but also it means that there's a good chance that the server already has Java 1.8 installed. (In a not so distant future, however, these major Linux distributions will probably have Java 11 as the default version; the next long-term stable Java version after Java 11 is probably going to be Java 17, so you are going to see many software require Java 11 for a while, and later Java 17.)