[HN Gopher] Save the planet Program in C, avoid Python, Perl
___________________________________________________________________
Save the planet Program in C, avoid Python, Perl
Author : gdrift
Score : 16 points
Date : 2021-11-18 21:47 UTC (1 hours ago)
(HTM) web link (www.cnx-software.com)
(TXT) w3m dump (www.cnx-software.com)
| whateveracct wrote:
| Not sure if this is satire or some light techie ecofascism
| angulardragon03 wrote:
| The "donate via crypto" links at the bottom make it even harder
| to tell
| Minor49er wrote:
| It seems unusual to have a post that makes an environmentalist
| statement about computer energy consumption, but then end it by
| requesting donations via cryptocurrencies which are mined through
| their enormous consumption of electricity.
| smoldesu wrote:
| Perl and Python are scripting languages, their energy savings
| come from the fact that the programmer is typically the only
| person who will be running it, so it makes more sense to write
| something that minimizes screen-on time than it does to micro-
| optimize an app that hundreds of thousands of people will
| interact with. It's entirely a matter of scale: if you're working
| server-side, I'd wager you're saving quite a bit of energy by not
| using an IDE that constantly relies on static analysis to make
| sure you're not shooting yourself in the foot.
| dmz73 wrote:
| You are right about Perlubie and Python being scripting
| languages but unfortunately people use them for full
| applications that use 10 to 100 times the memory and CPU of
| what is necessary. Now C and C++ are the other side of this
| coin where they could be 10 to 100 times more efficient than
| scripting languages but it is often difficult to get that right
| without a lot of work. But there are a number of languages in
| between where doing the correct thing is easy and CPU and
| memory efficiency is close to or on par with best C and C++. So
| we can have nice things after all!
| tablespoon wrote:
| > You are right about [Perl] and Python being scripting
| languages but unfortunately people use them for full
| applications that use 10 to 100 times the memory and CPU of
| what is necessary.
|
| And honestly, _that would be an improvement_. The trend seems
| to be to write more and more applications in JavaScript with
| Electron [1], which I unrigorously assume uses 10 to 100
| times the memory and CPU of an equivalent Python app (given
| Electron apps seem to most frequently make my fan spin or
| have some kind of memory leak requiring a force-kill).
|
| [1] Now ranking higher on Google than the subatomic particle:
| https://www.google.com/search?q=electron
| (https://archive.ph/J2HYI)
| Kranar wrote:
| That is true of Perl, but Python powers web apps viewed by
| billions of users, including reddit and instagram.
| FpUser wrote:
| And we also burn coal and other lovely stuff for energy.
| rodmena wrote:
| Python is not only a scripting language. It powers many many
| websites including Youtube. It's a full power limitless
| language. Your statement is simply wrong.
| Supermancho wrote:
| > Python is not only a scripting language.
|
| The Python (programming language) is. Ok, if you want to get
| pedantic you can talk about the language vs interpreter vs
| ecosystem? I'm not sure what you are getting at.
|
| > It powers many many websites including Youtube. It's a full
| power limitless language.
|
| Lots of things "power" Youtube. I'm not sure how that's
| important to point out.
| rodmena wrote:
| Oh yes, let's reinvent the Erlang/OTP in C just to save CPU
| cycles (I bet that won't be the case). Let's waste millions of
| hours of programmers' life, just to make a point.
|
| C or any "so called" efficient languages are wonderful for their
| use cases. Python or Erlang have other use cases. We have all of
| those languages for a reason.
| wfleming wrote:
| 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?
___________________________________________________________________
(page generated 2021-11-18 23:00 UTC)