Readit News logoReadit News
wfleming · 4 years ago
I realize this argument is probably tongue-in-cheek, but if we were to take it at face value it would be interesting to factor in energy costs required to feed/house/etc. the programmers for the additional time it would take to implement a given system in C vs python, and how often would the code need to run to make it balance out?
bogwog · 4 years ago
I realize this comment is probably tongue-in-cheek, but if we take it at face value, I think it’s failing to consider that the software’s enery usage is unbounded. An app, for example, may end up installed on millions of devices, or running 24/7 on a server for years.
fabatka · 4 years ago
I realize this comment is probably tongue-in-cheek, but if we take it at face value, I think it’s failing to consider that the logical conclusion of this argument is to write programs directly in binary.
yayr · 4 years ago
and this means, any mistake in the software is also replicated to those devices. let's say e.g. buffer overflows... and then efficiency is faster gone than achieved.
JasonFruit · 4 years ago
I realize this discussion is probably tongue-in-cheek, but if we take it at face value, I think it's failing to recognize that energy supply is not unbounded. An app, no matter how widely installed, cannot consume more energy than is produced.
topaz0 · 4 years ago
You are mistaken. It considers that in the part about "how many times the software would need to run to break even".
FpUser · 4 years ago
I write backend servers in C++. From my experience using modern C++ and libraries the amount of code (line wise) is about the same as in any other high level language like Python. Amount of time to write is about the same as well. I know because I've rewritten from the scratch large Python server application in C++. Performance however is hundreds of times better for C++.
rowanG077 · 4 years ago
This. Honestly any large program in Python suffers from massive maintenance issues because Python is dynamically typed.
neverartful · 4 years ago
Use Nim FTW on both fronts!
jcelerier · 4 years ago
yep, for instance a good benchmark would be: how long would it take to build a decent and snappy GUI operating system from scratch with a custom html/css/js engine in $LANGUAGE ?

To give a data point, in 2021-era C++ it's approximately 3 years with a very large part of it being done by a single person (https://github.com/SerenityOS/serenity). How long would that take with python ?

jhgb · 4 years ago
> with a custom html/css/js engine

That almost sounds like confusing goals with ways to me. Unless those very specific ways are your goal for some reason, if you were to "build a decent and snappy GUI operating system from scratch", you probably wouldn't end up with those things in it. You'd end up with something more similar to Oberon, Smalltalk, or VPRI's system (was it Frank or something like that?).

omegalulw · 4 years ago
Not really. Why would you do everything from scratch?
LAC-Tech · 4 years ago
It also means that doing personal projects in language with long compile times would be worse for the environment, and interpreted ones would be better.
asveikau · 4 years ago
I am pretty sure in most cases you build less often than you execute.
guerrilla · 4 years ago
> it would be interesting to factor in energy costs required to feed/house/etc.

Why would that be interesting? They'd exist and consume the same amount of energy regardless of what they worked on...

jacobr1 · 4 years ago
Not if you needed twice and many engineers, or it took twice as long due to a complexity.

But that said, the overhead of the engineers energy consumption is overhead that probably turns to nothing over the life of a successful project.

colejohnson66 · 4 years ago
It’s not energy/time that’s being compared; that’ll be the same. It’s total energy (energy/time * time). For example, a C++ GUI could take longer to get up and running than, say, Python. And assembly would take even longer.
scoofy · 4 years ago
I honestly hate headlines like this. Jokey, tongue-and-cheek takes that effectively treat environmentalism like every little bit counts. It doesn't.

We are in the midst of a serious crisis, we know the reasonable solutions we should be taking to avoid catastrophe, and we are collectively choosing to ignore them. It should be treated seriously. If we're going to joke about it, it should be dark comedy.

Mikeb85 · 4 years ago
This would make sense if all computers ever did was mathematical micro-benchmarks.

Can you create a web framework in C that has as many features as Rails or Django? And what's the power consumption of that?

Higher level languages do more stuff. It's not like Guido and Matz just woke up one day and were like "fuck your CPU".

Plus, compilation requires a decent amount of power, as shown in those graphs. Does every C/C++ project run perfectly with no bugs the first time?

quelsolaar · 4 years ago
Big companies like Facebook and Google do write their web tech in C/C++ because performance and power consumption does matter. If something written in Rails is ten times slower then in C, that means ten times more servers using ten times more power. As I'm sure you can imagine, cutting a zero of these companies server bills is a big deal. You can buy a lot of hours doing manual memory management for that kind of money.
notacoward · 4 years ago
I don't know about Google, but that certainly didn't seem to be the case at Facebook. PHP/Hack was the language of choice for front-end stuff, C++ for most of the code in infra services, and Python holding everything together.
Mikeb85 · 4 years ago
Yes, both are replacing some PHP/Python bits with C++ AFTER scaling to billions of users...

Still curious what the power savings are... I'm sure they've done enough profiling to know their performance is increasing. But are they saving energy? How about the compilation cycles to get to where they are? The carbon footprint of the additional employees? Etc...?

pwdisswordfish9 · 4 years ago
Matz did actually say pretty much that.

https://evrone.com/yukihiro-matsumoto-interview

aejnsn · 4 years ago
This comes from an academic who doesn’t support any code. Why would I spend the time as a developer to do manual memory management under the guise of efficiency, when instead I can support twice (arbitrary) as many apps making a computer do it for me? This is a human, whose carbon footprint is terrible compared to a little memory overhead. SMH. Silly articles.
alerighi · 4 years ago
Also a badly written C program can be more inefficient than a python one.
aejnsn · 4 years ago
Doesn’t matter. The fewer lines of Python are more maintainable in human hours. I am not debating the efficiency of the compiler or program. I am however stating there is a massive oversight on the maintenance of the code, which would lead to a net loss in human overhead.

Some napkin carbon footprint math—a computer on for eight hours daily does ~200 kg of CO2 in a given year. An average human on the planet is doing ~7,000 kg. Which means the average human’s 8-hour workday is ~6.4 kg CO2.

Yeah, let’s pull out the abacus and the slide rule while we’re at it, in the interest of carbon footprints. /s

quelsolaar · 4 years ago
Slow languages create greenhouse gasses, C does not produce more humans (yet).
aejnsn · 4 years ago
I understand that premise—read my prior comment again, or do you, like the author, also not understand how code is supported?
H8crilA · 4 years ago
Please no, a lot more energy and carbon will be wasted undoing the damage done by full stack engineers now suddenly finding out about memory management problems.
whateveracct · 4 years ago
Not sure if this is satire or some light techie ecofascism
angulardragon03 · 4 years ago
The “donate via crypto” links at the bottom make it even harder to tell
beepbooptheory · 4 years ago
I think there is another alternative: slightly goofy but also interesting research.
neuroscihacker · 4 years ago
I've written about this topic before and I think this is not right. Scroll down to "Environmental Impact".

https://towardsdatascience.com/high-performance-code-pays-di...

"The climate crisis threatens human civilization on a grand scale and electricity is frequently produced from fossil fuel. Electricity is then consumed by the operation of computer code. Google alone used 12.8 Terrawatt-hours in 2019 according to its 2020 environmental report, more than many countries and more than several US states. It seems intuitive that improving code efficiency should reduce environmental impact. Does it?

The answer is not at all clear and must be considered on a system by system basis. The main reason is induced demand.

...it will take a centrally coordinated process at both national and international levels that can allocate energy to different industrial and consumer sectors and manage the energy production mix on behalf of the whole of society. Only then we can solve this problem in a rational way that doesn’t depend on luck.

In fairness, software companies aren’t power companies, it’s a little ridiculous to expect them to build their own generation. What we can more expect from them is to pay taxes, divest from fossil fuel companies if they hold securities, and hold their total energy consumption under a ceiling set by a regulator while the society changes the energy mix as fast as possible."

wheelerof4te · 4 years ago
Besides the already mentioned "donate via crypto" red flag, this argument is NULL and void.

Different languages were made with a reason, and they solve different problems. Even Python can be efficient when your largest bottleneck is network or disk IO.

Nowadays we have Rust, which is slowly catching up to C speed, and sometimes even surpasses it.

C is a beautiful language when used in embedded space, where memory allocations are minimal. Once you start throwing mallocs left and right, you lose that simple elegance.