Seems unlikely, but at some point it might make sense. Of course if the resources (electricity, silicon, etc.) required by developers to implement such efficient code exceeds the estimated savings, then doing it would actually be worse. But think about all the build scripts constantly being invoked, for example. The energy used to develop them must be extremely overshadowed by the energy to execute them.
> Software used by a certain minimum number of users, and software used in certain fields (like medicine, transport, and finance) need to be subjected by regulatory agencies to certain objective (hence automated?) tests to ensure they meet some minimum reliability, usability, security, and performance requirements. In this regime, small-time SaaS software, or hobby projects, would not need any regulation, but flagship software products of Facebook, Google, SAP, Oracle, Tesla, etc would need it.
When you're in a custom ASIC though, there is no "just plug more RAM in", so I've had to jump through hoops to eliminate excessive allocations and push to other parts of the system the computations that require significant scratch space. But it all takes time and effort. The last two major refactors that restored our buffer took 6 months to complete. They did nothing to improve system functionality, they just bought us the space to implement new features.
That's a lot of developer time to burn for something that will help in the future, but isn't delivering value now.
And that's undoubtedly why we're always in a RAM crunch. We value tools for the speed in development and flexibility, but do not care about how much storage or power they waste. Otherwise JavaScript wouldn't be running the web.
For us the day will come where we atone for our sins and have to again put off feature updates for months of RAM optimization. But in the PC/server/mobile space, that day gets pushed off whenever people move on to better hardware. So why not continue to bloat your applications, really? There's little incentive to do otherwise. If clunky abstractions make your developers ever so slightly happier, what's the reason not to embrace them?
My work isn't the best out there in that regard, but by simply making the more obvious optimizations as you go you're already doing better than the majority, and I'm confident that any effort beyond that puts you in the top 10%.
"nobody does that" times 20 years of RAM getting ever bigger, ever cheaper; and you get where we are today.
Once upon a time, emacs was considered a hog: "Eight Megabytes And Constantly Swapping". We had to invent whole new layers of indirection and waste to come up with the current VScode type efforts.
"the hunger of apps for RAM" will never be satisfied, just like there will never be no books for the printing presses to print: We'll find some use for keeping the machines thrashing no matter how silly.