Properly in this context would mean achieving the same effect at the lowest possible overall expense of energy (including those of developer laptops) given specific hardware.
Google spends a lot of effort optimizing their software because they bear the energy cost of running it in their own data centers.
Websites do not bear the energy cost of running their code on enduser devices.
The lack of incentives turns energy waste into an externalty which means it is not factored into development.
It's not just the language though. It is also what's done with the language. Increased productivity also means all kinds of marginal convenience and monetization features will get implemented which gobble up additional compute cycles.
If everything were written in assembly we simply wouldn't have the human resources to implement 500 ad trackers on a web browser. Not to mention that the web browser would be far more rudimentary in the first place.
Please reflect on what you are saying. You stylize yourself as victim when you are actually benefiting from making harmful decisions and then rationalizing that harmful behavior with "but everyone else is doing it too".
The question is what someone who is aware of the issues and willing to act can do. Just because there are those who act irresponsibly does not prevent you from adjusting your behavior.
Well, then you may have a catch-22 where the expense of having your child could cause making the world unlivable for that child thus condemning it or its descendants to non-existence. Thus generalized to the whole population the best action to maintain the ability to have those valued children is to have fewer of them on average. So we're back to the same conclusion.
Political reality in america is that there were multiple changes of ruling party in the last decade and MPs being voted out on specific issues. Of course a representative multi-party system would be preferable, but it's not that it's impossible to achieve anything at all.
There's more one can do than just that. I do not own or use cars. I try limit my meat consumption (not entirely successful on that front). I changed energy providers to buy from renewables sources. I do not travel by air. I don't have air conditioning.
I also sit on a pile of money, not sure what to do with it. Index stocks contain fossil companies which I don't want to support. Maybe I'll throw some at those silicate weathering pilot projects.
Specialized data structures can be built that contain primitives and other types supporting this kind of thing. But you still can't store arbitrary data because they could contain FFI pointers, handles to native resources, things that need to run destructors etc.
So to do this safely all the types must be whitelisted through a custom trait. Copy is close, but not quite, since references are still Copy.
That's not possible to do safely for arbitrary data structures because they can contain pointers or references. If you reload to a different address then the pointers, even within the allocated chunk, would be invalid and require fixup. And if you require fixup then you might as well do (de)serialization for your data structures.
Just allocating into such a memory region (essentially custom page swapping) will eventually be possible with data structures that can be constructed with custom allocators, but it still wouldn't be ok to reload those.
Google spends a lot of effort optimizing their software because they bear the energy cost of running it in their own data centers.
Websites do not bear the energy cost of running their code on enduser devices.
The lack of incentives turns energy waste into an externalty which means it is not factored into development.