I think this would make the user experience significantly more palatable, though there are still some considerations:
- This hinges on coming up with some sufficiently-high-level representation that gives more ABI flexibility, the specifics of which would determine how much flexibility is possible. On a spectrum from source code → SIL → LLVM IR → binary, you'd probably want to land somewhere between source code and SIL, but how close to either has some pros and cons:
- SIL has the benefit of being a target-independent representation that exists today, though may still be too low-level to represent some of the ABI changes I've seen pitched over the years, which may transform how code is generated quite significantly. Java and the JVM, for example, have the benefit of "merely" needing to adapt code to specific architectures, but also don't typically deal with utter source- and ABI-breaking changes (examples of pitches of which are easily found here on the forums)
- Source code has the benefit of being maximally-flexible and accommodating of significant ABI changes, but many folks would probably be pretty uncomfortable shipping their raw source code around
- Something intermediate would require designing and coming up with something brand new, and inserting it into the compiler pipeline
- There are significant resource implications for having every single device out there recompile the same apps over and over again from a power consumption and environmental perspective: right now, my company's app is compiled once and downloaded by hundreds of thousands of devices; I can't imagine the resource costs of instead having each and every one of those devices instead compile the app locally
- This still doesn't resolve the issue of precompiled 3rd-party frameworks, which are a real-world concern. Having to deal with these frameworks when you have no other choice can already be a massive pain, but having to ship one-per-ABI because they can't be recompiled locally sounds like an incoming migraine. (Said as someone whose team has to suffer poorly-written, precompiled 3rd-party frameworks with no alternative)
In all, I think this is an interesting exercise, but at the end of the day, ABI stability wasn't chosen arbitrarily. Yes, it absolutely does at times feel frustratingly self-limiting, but the alternatives are typically far worse. There's a reason that the vast majority of languages either commit to ABI stability, or ignore it altogether (with no real in-between).