3 ms·
I'm reminded of The Good Place's Chidi. If you go down this route, you're likely to become paralyzed as you consider all the possible ways you might be harming
by Jtsummers 6y ago
I'm reminded of The Good Place's Chidi. If you go down this route, you're likely to become paralyzed as you consider all the possible ways you might be harming others.
If the only factor in the energy consumption of a program was the efficiency of the code, then maybe. But different languages have different development and maintenance costs as well (both in terms of human and computer time). Different design decisions as well.
Hand-tuned assembler with mostly static bounds on memory consumption could lead to much more efficient executables (in terms of raw cycles). And compilation would be a relatively simple translation step, much faster than compiling every other language. But at a severe cost of often non-reusable code (so more time is spent writing the same things over and over), more time debugging the code (unless you're really good at assembly or working on small programs).
At a minimum we could consider a "simpler" (by various measures) language like Pascal or C where it's relatively straightforward to reuse code, and compilation isn't as time consuming and can be fairly well optimized. But then we have to remember, there are reasons other languages are made. Usually having to do with programming ergonomics for particular problem domains. Then you build your Datalog or SQL interpreter on top of one of these languages and we're back to something "inefficient" (not fully optimized).
And on this goes. We could ask much better questions like: Is most code worth writing/running? Should we have several of the biggest tech companies in the US be, fundamentally, advertising companies? They produce and promote much more energy waste with their software than any programmer's inefficient code is going to produce.