Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #163577 > unrolled thread

"C Is The Greenest Programming Language" by: Chris Lott

Started byLynn McGuire <lynnmcguire5@gmail.com>
First post2021-11-22 16:19 -0600
Last post2021-12-06 16:21 +0100
Articles 20 on this page of 94 — 22 participants

Back to article view | Back to comp.lang.c


Contents

  "C Is The Greenest Programming Language" by: Chris Lott Lynn McGuire <lynnmcguire5@gmail.com> - 2021-11-22 16:19 -0600
    Re: "C Is The Greenest Programming Language" by: Chris Lott "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-11-22 14:58 -0800
      Re: "C Is The Greenest Programming Language" by: Chris Lott Juha Nieminen <nospam@thanks.invalid> - 2021-11-23 07:10 +0000
        Re: "C Is The Greenest Programming Language" by: Chris Lott "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-11-23 13:12 -0800
          Re: "C Is The Greenest Programming Language" by: Chris Lott Juha Nieminen <nospam@thanks.invalid> - 2021-11-24 10:54 +0000
            Re: "C Is The Greenest Programming Language" by: Chris Lott Philipp Klaus Krause <pkk@spth.de> - 2021-11-24 12:01 +0100
              Re: "C Is The Greenest Programming Language" by: Chris Lott David Brown <david.brown@hesbynett.no> - 2021-11-24 13:58 +0100
        Re: "C Is The Greenest Programming Language" by: Chris Lott "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-11-23 13:23 -0800
    Re: "C Is The Greenest Programming Language" by: Chris Lott Richard Damon <Richard@Damon-Family.org> - 2021-11-22 18:25 -0500
      Re: "C Is The Greenest Programming Language" by: Chris Lott Juha Nieminen <nospam@thanks.invalid> - 2021-11-23 07:21 +0000
        Re: "C Is The Greenest Programming Language" by: Chris Lott Thiago Adams <thiago.adams@gmail.com> - 2021-11-23 04:50 -0800
        Re: "C Is The Greenest Programming Language" by: Chris Lott Guillaume <message@bottle.org> - 2021-11-23 17:56 +0100
          Re: "C Is The Greenest Programming Language" by: Chris Lott Juha Nieminen <nospam@thanks.invalid> - 2021-11-24 10:55 +0000
        Re: "C Is The Greenest Programming Language" by: Chris Lott Lynn McGuire <lynnmcguire5@gmail.com> - 2021-11-23 19:00 -0600
          Re: "C Is The Greenest Programming Language" by: Chris Lott scott@slp53.sl.home (Scott Lurndal) - 2021-11-24 16:04 +0000
      Re: "C Is The Greenest Programming Language" by: Chris Lott Philipp Klaus Krause <pkk@spth.de> - 2021-11-24 11:43 +0100
    Re: "C Is The Greenest Programming Language" by: Chris Lott om@iki.fi (Otto J. Makela) - 2021-11-23 14:17 +0200
      Re: "C Is The Greenest Programming Language" by: Chris Lott DozingDog@thekennel.co - 2021-11-23 16:53 +0000
        Re: "C Is The Greenest Programming Language" by: Chris Lott om@iki.fi (Otto J. Makela) - 2021-11-24 11:40 +0200
          Re: "C Is The Greenest Programming Language" by: Chris Lott DozingDog@thekennel.co - 2021-11-24 15:49 +0000
      Re: "C Is The Greenest Programming Language" by: Chris Lott Lynn McGuire <lynnmcguire5@gmail.com> - 2021-11-23 19:01 -0600
        Re: "C Is The Greenest Programming Language" by: Chris Lott om@iki.fi (Otto J. Makela) - 2021-11-24 11:33 +0200
          Re: "C Is The Greenest Programming Language" by: Chris Lott Lynn McGuire <lynnmcguire5@gmail.com> - 2021-11-24 15:28 -0600
    Re: "C Is The Greenest Programming Language" by: Chris Lott Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-23 14:39 +0100
      Re: "C Is The Greenest Programming Language" by: Chris Lott DozingDog@thekennel.co - 2021-11-23 16:55 +0000
        Re: "C Is The Greenest Programming Language" by: Chris Lott Richard Damon <Richard@Damon-Family.org> - 2021-11-23 12:28 -0500
          Re: "C Is The Greenest Programming Language" by: Chris Lott Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-23 19:05 +0100
            Re: "C Is The Greenest Programming Language" by: Chris Lott Richard Damon <Richard@Damon-Family.org> - 2021-11-23 13:41 -0500
              Re: "C Is The Greenest Programming Language" by: Chris Lott Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-23 19:53 +0100
                Re: "C Is The Greenest Programming Language" by: Chris Lott Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-11-23 16:31 -0800
                Re: "C Is The Greenest Programming Language" by: Chris Lott Richard Damon <Richard@Damon-Family.org> - 2021-11-23 21:27 -0500
                  Re: "C Is The Greenest Programming Language" by: Chris Lott Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-24 18:32 +0100
                    Re: "C Is The Greenest Programming Language" by: Chris Lott Richard Damon <Richard@Damon-Family.org> - 2021-11-24 12:54 -0500
                      Re: "C Is The Greenest Programming Language" by: Chris Lott Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-24 20:52 +0100
                        Re: "C Is The Greenest Programming Language" by: Chris Lott Richard Damon <Richard@Damon-Family.org> - 2021-11-24 15:13 -0500
                          Re: "C Is The Greenest Programming Language" by: Chris Lott Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-25 19:13 +0100
            Re: "C Is The Greenest Programming Language" by: Chris Lott Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-11-23 16:25 -0800
          Re: "C Is The Greenest Programming Language" by: Chris Lott DozingDog@thekennel.co - 2021-11-24 15:48 +0000
            Re: "C Is The Greenest Programming Language" by: Chris Lott Richard Damon <Richard@Damon-Family.org> - 2021-11-24 11:54 -0500
              Re: "C Is The Greenest Programming Language" by: Chris Lott DozingDog@thekennel.co - 2021-11-25 11:19 +0000
                Re: "C Is The Greenest Programming Language" by: Chris Lott Juha Nieminen <nospam@thanks.invalid> - 2021-11-25 11:46 +0000
                  Re: "C Is The Greenest Programming Language" by: Chris Lott DozingDog@thekennel.co - 2021-11-25 15:57 +0000
                Re: "C Is The Greenest Programming Language" by: Chris Lott Richard Damon <Richard@Damon-Family.org> - 2021-11-25 07:04 -0500
                  Re: "C Is The Greenest Programming Language" by: Chris Lott DozingDog@thekennel.co - 2021-11-25 15:59 +0000
                  Re: "C Is The Greenest Programming Language" by: Chris Lott Thiago Adams <thiago.adams@gmail.com> - 2021-11-26 03:37 -0800
    Re: "C Is The Greenest Programming Language" by: Chris Lott Manfred <noname@add.invalid> - 2021-11-23 16:03 +0100
      Re: "C Is The Greenest Programming Language" by: Chris Lott gazelle@shell.xmission.com (Kenny McCormack) - 2021-11-23 15:50 +0000
        Re: "C Is The Greenest Programming Language" by: Chris Lott David Brown <david.brown@hesbynett.no> - 2021-11-23 17:51 +0100
          Re: "C Is The Greenest Programming Language" by: Chris Lott DozingDog@thekennel.co - 2021-11-23 17:00 +0000
            Re: "C Is The Greenest Programming Language" by: Chris Lott Richard Damon <Richard@Damon-Family.org> - 2021-11-23 12:36 -0500
            Re: "C Is The Greenest Programming Language" by: Chris Lott David Brown <david.brown@hesbynett.no> - 2021-11-23 19:24 +0100
              Re: "C Is The Greenest Programming Language" by: Chris Lott Richard Damon <Richard@Damon-Family.org> - 2021-11-23 13:50 -0500
                Re: "C Is The Greenest Programming Language" by: Chris Lott David Brown <david.brown@hesbynett.no> - 2021-11-23 20:02 +0100
          Re: "C Is The Greenest Programming Language" by: Chris Lott Manfred <noname@add.invalid> - 2021-11-23 20:59 +0100
            Re: "C Is The Greenest Programming Language" by: Chris Lott Bart <bc@freeuk.com> - 2021-11-23 20:50 +0000
              Re: "C Is The Greenest Programming Language" by: Chris Lott Ian Collins <ian-news@hotmail.com> - 2021-11-24 11:18 +1300
                Re: "C Is The Greenest Programming Language" by: Chris Lott Bart <bc@freeuk.com> - 2021-11-23 22:58 +0000
              Re: "C Is The Greenest Programming Language" by: Chris Lott David Brown <david.brown@hesbynett.no> - 2021-11-23 23:46 +0100
                Re: "C Is The Greenest Programming Language" by: Chris Lott Bart <bc@freeuk.com> - 2021-11-24 13:59 +0000
                  Re: "C Is The Greenest Programming Language" by: Chris Lott antispam@math.uni.wroc.pl - 2021-12-11 13:25 +0000
                    Re: "C Is The Greenest Programming Language" by: Chris Lott Bart <bc@freeuk.com> - 2021-12-11 14:54 +0000
              Re: "C Is The Greenest Programming Language" by: Chris Lott Manfred <noname@add.invalid> - 2021-11-25 12:12 +0100
            Re: "C Is The Greenest Programming Language" by: Chris Lott David Brown <david.brown@hesbynett.no> - 2021-11-23 23:35 +0100
              Re: "C Is The Greenest Programming Language" by: Chris Lott Manfred <noname@add.invalid> - 2021-11-24 15:30 +0100
                Re: "C Is The Greenest Programming Language" by: Chris Lott Bart <bc@freeuk.com> - 2021-11-24 14:43 +0000
        Re: "C Is The Greenest Programming Language" by: Chris Lott Manfred <noname@add.invalid> - 2021-11-23 20:29 +0100
      Re: "C Is The Greenest Programming Language" by: Chris Lott Bart <bc@freeuk.com> - 2021-11-23 16:14 +0000
      Re: "C Is The Greenest Programming Language" by: Chris Lott Philipp Klaus Krause <pkk@spth.de> - 2021-11-24 11:56 +0100
        Re: "C Is The Greenest Programming Language" by: Chris Lott Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-11-24 10:14 -0800
          Re: "C Is The Greenest Programming Language" by: Chris Lott David Brown <david.brown@hesbynett.no> - 2021-11-24 19:55 +0100
            Re: "C Is The Greenest Programming Language" by: Chris Lott Philipp Klaus Krause <pkk@spth.de> - 2021-11-24 21:13 +0100
          Re: "C Is The Greenest Programming Language" by: Chris Lott Philipp Klaus Krause <pkk@spth.de> - 2021-11-24 21:11 +0100
        Re: "C Is The Greenest Programming Language" by: Chris Lott Philipp Klaus Krause <pkk@spth.de> - 2021-11-24 21:17 +0100
          Re: "C Is The Greenest Programming Language" by: Chris Lott Bart <bc@freeuk.com> - 2021-11-24 20:42 +0000
            Re: "C Is The Greenest Programming Language" by: Chris Lott Philipp Klaus Krause <pkk@spth.de> - 2021-11-24 23:25 +0100
            Re: "C Is The Greenest Programming Language" by: Chris Lott antispam@math.uni.wroc.pl - 2021-12-11 14:07 +0000
              Re: "C Is The Greenest Programming Language" by: Chris Lott Bart <bc@freeuk.com> - 2021-12-11 18:46 +0000
                [OT] Lisp.  Was: "C Is The Greenest Programming Language" by: Chris Lott Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-11 20:11 +0000
                  Re: "C Is The Greenest Programming Language" Dave Dunfield <dave.dunfield@gmail.com> - 2021-12-13 17:59 -0800
                    Re: "C Is The Greenest Programming Language" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-14 03:18 +0000
                      Re: "C Is The Greenest Programming Language" Dave Dunfield <dave.dunfield@gmail.com> - 2021-12-16 10:57 -0800
                        Re: "C Is The Greenest Programming Language" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-16 22:03 +0000
                          Re: "C Is The Greenest Programming Language" Dave Dunfield <dave.dunfield@gmail.com> - 2021-12-20 02:40 -0800
                            Re: "C Is The Greenest Programming Language" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-20 12:05 +0000
    Re: "C Is The Greenest Programming Language" by: Chris Lott "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-11-24 14:12 -0800
      Re: "C Is The Greenest Programming Language" by: Chris Lott Manfred <noname@add.invalid> - 2021-11-25 12:00 +0100
    Re: "C Is The Greenest Programming Language" by: Chris Lott Paavo Helde <eesnimi@osa.pri.ee> - 2021-12-05 22:51 +0200
      Re: "C Is The Greenest Programming Language" by: Chris Lott "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-12-05 19:20 -0800
        Re: "C Is The Greenest Programming Language" by: Chris Lott Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-12-06 01:52 -0800
          Re: "C Is The Greenest Programming Language" by: Chris Lott "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-12-06 12:19 -0800
            Re: "C Is The Greenest Programming Language" by: Chris Lott "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-12-06 12:27 -0800
      Re: "C Is The Greenest Programming Language" by: Chris Lott Manfred <noname@add.invalid> - 2021-12-06 12:28 +0100
        Re: "C Is The Greenest Programming Language" by: Chris Lott Paavo Helde <eesnimi@osa.pri.ee> - 2021-12-06 13:40 +0200
      Re: "C Is The Greenest Programming Language" by: Chris Lott Bonita Montero <Bonita.Montero@gmail.com> - 2021-12-06 16:21 +0100

Page 1 of 5  [1] 2 3 4 5  Next page →


#163577 — "C Is The Greenest Programming Language" by: Chris Lott

FromLynn McGuire <lynnmcguire5@gmail.com>
Date2021-11-22 16:19 -0600
Subject"C Is The Greenest Programming Language" by: Chris Lott
Message-ID<snh51g$c1q$1@dont-email.me>
"C Is The Greenest Programming Language" by: Chris Lott
    https://hackaday.com/2021/11/18/c-is-the-greenest-programming-language/

"Have you ever wondered if there is a correlation between a computer’s 
energy consumption and the choice of programming languages? Well, a 
group Portuguese university researchers did and set out to quantify it. 
Their 2017 research paper entitled Energy Efficiency across Programming 
Languages / How Do Energy, Time, and Memory Relate?  may have escaped 
your attention, as it did ours."
    https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf

"Abstract: This paper presents a study of the runtime, memory usage and 
energy consumption of twenty seven well-known soft- ware languages. We 
monitor the performance of such lan- guages using ten different 
programming problems, expressed in each of the languages. Our results 
show interesting find- ings, such as, slower/faster languages consuming 
less/more energy, and how memory usage influences energy consump- tion. 
We show how to use our results to provide software engineers support to 
decide which language to use when energy efficiency is a concern."

Lynn

[toc] | [next] | [standalone]


#163578

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2021-11-22 14:58 -0800
Message-ID<snh7bj$qjj$1@dont-email.me>
In reply to#163577
On 11/22/2021 2:19 PM, Lynn McGuire wrote:
> "C Is The Greenest Programming Language" by: Chris Lott
>     https://hackaday.com/2021/11/18/c-is-the-greenest-programming-language/
> 
> "Have you ever wondered if there is a correlation between a computer’s 
> energy consumption and the choice of programming languages? Well, a 
> group Portuguese university researchers did and set out to quantify it. 
> Their 2017 research paper entitled Energy Efficiency across Programming 
> Languages / How Do Energy, Time, and Memory Relate?  may have escaped 
> your attention, as it did ours."
>     https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf
> 
> "Abstract: This paper presents a study of the runtime, memory usage and 
> energy consumption of twenty seven well-known soft- ware languages. We 
> monitor the performance of such lan- guages using ten different 
> programming problems, expressed in each of the languages. Our results 
> show interesting find- ings, such as, slower/faster languages consuming 
> less/more energy, and how memory usage influences energy consump- tion. 
> We show how to use our results to provide software engineers support to 
> decide which language to use when energy efficiency is a concern."

Interesting. However, I can write something in C that uses all CPU's 
100%. So, green okay... What is it doing, is another matter, so to speak?

[toc] | [prev] | [next] | [standalone]


#163587

FromJuha Nieminen <nospam@thanks.invalid>
Date2021-11-23 07:10 +0000
Message-ID<sni44d$1l1s$1@gioia.aioe.org>
In reply to#163578
In comp.lang.c++ Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
> Interesting. However, I can write something in C that uses all CPU's 
> 100%.

I don't think that's the point.

[toc] | [prev] | [next] | [standalone]


#163622

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2021-11-23 13:12 -0800
Message-ID<snjlgi$h25$1@dont-email.me>
In reply to#163587
On 11/22/2021 11:10 PM, Juha Nieminen wrote:
> In comp.lang.c++ Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
>> Interesting. However, I can write something in C that uses all CPU's
>> 100%.
> 
> I don't think that's the point.
> 

Humm... I was just thinking along the lines of 'what does the C code 
actually do?' If it ends up blasting the system, how green is it? Well, 
yeah, that is a different point. You are right Juha.

[toc] | [prev] | [next] | [standalone]


#163640

FromJuha Nieminen <nospam@thanks.invalid>
Date2021-11-24 10:54 +0000
Message-ID<snl5k6$1ges$1@gioia.aioe.org>
In reply to#163622
In comp.lang.c++ Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
> On 11/22/2021 11:10 PM, Juha Nieminen wrote:
>> In comp.lang.c++ Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
>>> Interesting. However, I can write something in C that uses all CPU's
>>> 100%.
>> 
>> I don't think that's the point.
>> 
> 
> Humm... I was just thinking along the lines of 'what does the C code 
> actually do?' If it ends up blasting the system, how green is it? Well, 
> yeah, that is a different point. You are right Juha.

I am assuming that the article considers the cases where the CPU is at
full load in all the cases, with the program having been implemented
with different programming languages. The faster the program is done,
the less overall energy it will require. If a C program does the job
in 1 second and a PHP program does it in 30 seconds, it's obvious that
the C program is going to consume less energy for the same task.

So it's not a question of "how many % of the CPU can I use with this
programming language", but "how long do I need to use the CPU in
order to perform this task".

[toc] | [prev] | [next] | [standalone]


#163643

FromPhilipp Klaus Krause <pkk@spth.de>
Date2021-11-24 12:01 +0100
Message-ID<snl62r$98t$1@solani.org>
In reply to#163640
Am 24.11.21 um 11:54 schrieb Juha Nieminen:
> 
> So it's not a question of "how many % of the CPU can I use with this
> programming language", but "how long do I need to use the CPU in
> order to perform this task".
> 

On the other hand, the energy consumption of that CPU during that time
also depends on what it is doing (and to some degree an what data it is
processing). People have been doing side-channel attacks on cryptography
by very accurately measuring the energy consumption of the computers
doing the encrypting or decrypting.

Long ago, for fun, I did measure the energy consumption of a Z80 (in a
ColecoVision) with reasonably high time resolution (current probe on
oscilloscope). From the trace of the energy consumption, I could see
which instructions were executed.

[toc] | [prev] | [next] | [standalone]


#163644

FromDavid Brown <david.brown@hesbynett.no>
Date2021-11-24 13:58 +0100
Message-ID<snlctj$dch$1@dont-email.me>
In reply to#163643
On 24/11/2021 12:01, Philipp Klaus Krause wrote:
> Am 24.11.21 um 11:54 schrieb Juha Nieminen:
>>
>> So it's not a question of "how many % of the CPU can I use with this
>> programming language", but "how long do I need to use the CPU in
>> order to perform this task".
>>
> 
> On the other hand, the energy consumption of that CPU during that time
> also depends on what it is doing (and to some degree an what data it is
> processing). People have been doing side-channel attacks on cryptography
> by very accurately measuring the energy consumption of the computers
> doing the encrypting or decrypting.
> 
> Long ago, for fun, I did measure the energy consumption of a Z80 (in a
> ColecoVision) with reasonably high time resolution (current probe on
> oscilloscope). From the trace of the energy consumption, I could see
> which instructions were executed.
> 

I used to debug my assembly code on my ZX Spectrum (with a Z80 cpu) by
the sound of the power supply.

However, with modern cpus there is so much going on that you are
unlikely to get much detail by tracking power consumption.  You could
perhaps distinguish when blocks such as SIMD or the FPU are active, but
otherwise there are so many instructions in flight at a time that you
could not identify them.  Differential power analysis for cryptoanalysis
is almost entirely a thing of the past.  (It could be practical for
simpler processors and dedicated cryptography devices, except that
designers of these things are usually aware of such attacks and they are
easily blocked.)

[toc] | [prev] | [next] | [standalone]


#163623

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2021-11-23 13:23 -0800
Message-ID<snjm59$lg1$1@dont-email.me>
In reply to#163587
On 11/22/2021 11:10 PM, Juha Nieminen wrote:
> In comp.lang.c++ Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
>> Interesting. However, I can write something in C that uses all CPU's
>> 100%.
> 
> I don't think that's the point.
> 

Side note: Humm... Perhaps we can say that lock-free is "greener" than 
using locks. Say a computation using a nice lock-free algo takes 5 
minutes. Vs, something using locks that takes 30 minutes to get the same 
result. I remember back in the day where I had to terminate the 
lock-based tests because they took way too long.

[toc] | [prev] | [next] | [standalone]


#163579

FromRichard Damon <Richard@Damon-Family.org>
Date2021-11-22 18:25 -0500
Message-ID<hGVmJ.45875$Gco3.43326@fx01.iad>
In reply to#163577
On 11/22/21 5:19 PM, Lynn McGuire wrote:
> "C Is The Greenest Programming Language" by: Chris Lott
>     https://hackaday.com/2021/11/18/c-is-the-greenest-programming-language/
> 
> "Have you ever wondered if there is a correlation between a computer’s 
> energy consumption and the choice of programming languages? Well, a 
> group Portuguese university researchers did and set out to quantify it. 
> Their 2017 research paper entitled Energy Efficiency across Programming 
> Languages / How Do Energy, Time, and Memory Relate?  may have escaped 
> your attention, as it did ours."
>     https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf
> 
> "Abstract: This paper presents a study of the runtime, memory usage and 
> energy consumption of twenty seven well-known soft- ware languages. We 
> monitor the performance of such lan- guages using ten different 
> programming problems, expressed in each of the languages. Our results 
> show interesting find- ings, such as, slower/faster languages consuming 
> less/more energy, and how memory usage influences energy consump- tion. 
> We show how to use our results to provide software engineers support to 
> decide which language to use when energy efficiency is a concern."
> 
> Lynn

Well since one of the goals of the C Language was to enable programmers 
to write fast code, it can makes sense for C to be 'Green', at least by 
some measures.

Fast code will be more energy efficient as processors basically use 
power based on the number of instructions executed (and memory accessed).

What also needs to be considered is the time/energy needed to initially 
WRITE the code and get it working, and then factor in how many times the 
program will be used compared to the effort to write it.

[toc] | [prev] | [next] | [standalone]


#163588

FromJuha Nieminen <nospam@thanks.invalid>
Date2021-11-23 07:21 +0000
Message-ID<sni4pq$1v37$1@gioia.aioe.org>
In reply to#163579
In comp.lang.c++ Richard Damon <Richard@damon-family.org> wrote:
> Well since one of the goals of the C Language was to enable programmers 
> to write fast code, it can makes sense for C to be 'Green', at least by 
> some measures.
> 
> Fast code will be more energy efficient as processors basically use 
> power based on the number of instructions executed (and memory accessed).

I think that for as long as programmable computers have existed, there has
been a direct correlation between the "levelness" ("higher-level" vs.
"low-level") of a language and disregard towards how much resources the
language uses. As computers have become faster and faster, and the amount
of resources (primarily RAM) has increased, this indifference towards
resource consumption in higher-level languages has only likewise
increased.

The farther away the design of the language has been from the details of
the underlying hardware, the more the question of "how efficient is
the language, and how much RAM does it consume?" has been (implicitly
or explicitly) answered with, essentially, "it doesn't matter" and
"who cares?"

Take pretty much any scripting language, or any other interpreted
language (like the original BASIC and most of its subsequent variants).
Pretty much nobody cared how fast they are, or how much RAM they
consume. When someone is, let's say, implementing something in PHP
they seldom stop to think how much memory it consumes or how fast it is.
When someone is implementing something in shell script, one most
definitely does not think about speed or memory consumption.

Most object-oriented languages don't really care about, especially,
memory consumption. Especially garbage-collected OO languages don't
give a flying F about memory consumption. So what if an object needs
something like 16 or 32 bytes of bookeeping data? Who cares? That's
nothing! Trivial and inconsequential! Modern computers have gigabytes
of RAM! Why should you care if an object takes 32 bytes in addition
to whatever is inside it? What a silly notion!

Ironically, the programming world has in the last couple of decades awakened
to the harsh realization that this complete disregard of memory usage
actually causes inefficiencies in modern CPU architectures (because
cache misses are very expensive).

Oh well. As long as it works, who cares? Buy a faster computer.

[toc] | [prev] | [next] | [standalone]


#163592

FromThiago Adams <thiago.adams@gmail.com>
Date2021-11-23 04:50 -0800
Message-ID<541614ef-443b-49b4-b5cb-72540d1fa9c1n@googlegroups.com>
In reply to#163588
On Tuesday, November 23, 2021 at 4:21:44 AM UTC-3, Juha Nieminen wrote:
...
> Oh well. As long as it works, who cares? Buy a faster computer.
Everything costs money, especially on cloud solutions. 

[toc] | [prev] | [next] | [standalone]


#163606

FromGuillaume <message@bottle.org>
Date2021-11-23 17:56 +0100
Message-ID<snj6h2$kf3$1@gioia.aioe.org>
In reply to#163588
Le 23/11/2021 à 08:21, Juha Nieminen a écrit :
> Oh well. As long as it works, who cares? Buy a faster computer.

This sentence shows that you quite obviously got what "green" means.

[toc] | [prev] | [next] | [standalone]


#163641

FromJuha Nieminen <nospam@thanks.invalid>
Date2021-11-24 10:55 +0000
Message-ID<snl5m3$1ges$2@gioia.aioe.org>
In reply to#163606
In comp.lang.c++ Guillaume <message@bottle.org> wrote:
> Le 23/11/2021 à 08:21, Juha Nieminen a écrit :
>> Oh well. As long as it works, who cares? Buy a faster computer.
> 
> This sentence shows that you quite obviously got what "green" means.

I have no idea what you are talking about.

Maybe you missed the fact that that sentence you quoted is sarcastic?

[toc] | [prev] | [next] | [standalone]


#163631

FromLynn McGuire <lynnmcguire5@gmail.com>
Date2021-11-23 19:00 -0600
Message-ID<snk2qp$2hc$1@dont-email.me>
In reply to#163588
On 11/23/2021 1:21 AM, Juha Nieminen wrote:
> In comp.lang.c++ Richard Damon <Richard@damon-family.org> wrote:
>> Well since one of the goals of the C Language was to enable programmers
>> to write fast code, it can makes sense for C to be 'Green', at least by
>> some measures.
>>
>> Fast code will be more energy efficient as processors basically use
>> power based on the number of instructions executed (and memory accessed).
> 
> I think that for as long as programmable computers have existed, there has
> been a direct correlation between the "levelness" ("higher-level" vs.
> "low-level") of a language and disregard towards how much resources the
> language uses. As computers have become faster and faster, and the amount
> of resources (primarily RAM) has increased, this indifference towards
> resource consumption in higher-level languages has only likewise
> increased.
> 
> The farther away the design of the language has been from the details of
> the underlying hardware, the more the question of "how efficient is
> the language, and how much RAM does it consume?" has been (implicitly
> or explicitly) answered with, essentially, "it doesn't matter" and
> "who cares?"
> 
> Take pretty much any scripting language, or any other interpreted
> language (like the original BASIC and most of its subsequent variants).
> Pretty much nobody cared how fast they are, or how much RAM they
> consume. When someone is, let's say, implementing something in PHP
> they seldom stop to think how much memory it consumes or how fast it is.
> When someone is implementing something in shell script, one most
> definitely does not think about speed or memory consumption.
> 
> Most object-oriented languages don't really care about, especially,
> memory consumption. Especially garbage-collected OO languages don't
> give a flying F about memory consumption. So what if an object needs
> something like 16 or 32 bytes of bookeeping data? Who cares? That's
> nothing! Trivial and inconsequential! Modern computers have gigabytes
> of RAM! Why should you care if an object takes 32 bytes in addition
> to whatever is inside it? What a silly notion!
> 
> Ironically, the programming world has in the last couple of decades awakened
> to the harsh realization that this complete disregard of memory usage
> actually causes inefficiencies in modern CPU architectures (because
> cache misses are very expensive).
> 
> Oh well. As long as it works, who cares? Buy a faster computer.

Not in California.
 
https://nichegamer.com/high-end-gaming-pcs-banned-in-six-us-states-after-california-energy-bill-limits-sales-on-high-performance-pcs/

Lynn

[toc] | [prev] | [next] | [standalone]


#163651

Fromscott@slp53.sl.home (Scott Lurndal)
Date2021-11-24 16:04 +0000
Message-ID<2otnJ.21405$b%.15512@fx24.iad>
In reply to#163631
Lynn McGuire <lynnmcguire5@gmail.com> writes:
>On 11/23/2021 1:21 AM, Juha Nieminen wrote:
>> In comp.lang.c++ Richard Damon <Richard@damon-family.org> wrote:

>> Ironically, the programming world has in the last couple of decades awakened
>> to the harsh realization that this complete disregard of memory usage
>> actually causes inefficiencies in modern CPU architectures (because
>> cache misses are very expensive).
>> 
>> Oh well. As long as it works, who cares? Buy a faster computer.
>
>Not in California.

And Hawaii, Colorado, Oregon, Vermont and Washington State.

Why did you single out California?

And one can certainly purchase the most powerful computers in all of those
states by assembling them personally - note also that servers aren't covered
by the regulation, only desktop systems.

Did you actually read the article you posted a link to?

Here's an article without the panic, and with actual, you know, facts.

https://www.makeuseof.com/why-the-california-ban-on-power-hogging-pcs-is-a-good-thing/

[toc] | [prev] | [next] | [standalone]


#163639

FromPhilipp Klaus Krause <pkk@spth.de>
Date2021-11-24 11:43 +0100
Message-ID<snl50k$8gg$1@solani.org>
In reply to#163579
Am 23.11.21 um 00:25 schrieb Richard Damon:
> 
> Well since one of the goals of the C Language was to enable programmers
> to write fast code, it can makes sense for C to be 'Green', at least by
> some measures.
> 
> Fast code will be more energy efficient as processors basically use
> power based on the number of instructions executed (and memory accessed).

The paper mentions that that is a common assumption, but not true.

Looking at table 4, we see that C is in the top spot both when it comes
to fast code and energy efficient code. And many other languages also
rank similarly in energy consumption as they do in speed. But there are
others. E.g.:

Go is fast (only 183% slower than C), but energy inefficient (323% more
energy consumed than C).

Lisp is slow (240% slower than C) but energy efficient (127% more energy
consumed than C).

[toc] | [prev] | [next] | [standalone]


#163591

Fromom@iki.fi (Otto J. Makela)
Date2021-11-23 14:17 +0200
Message-ID<87ilwjoykx.fsf@tigger.extechop.net>
In reply to#163577
Lynn McGuire <lynnmcguire5@gmail.com> wrote:

> "C Is The Greenest Programming Language" by: Chris Lott
>    https://hackaday.com/2021/11/18/c-is-the-greenest-programming-language/

Perhaps one contributing factor is that not so much development is any
longer done using C or C++, and the programs that are run (and still
being developed) were originally created in the era when CPU power was
much lower than these days, so code optimization was more important.
-- 
   /* * * Otto J. Makela <om@iki.fi> * * * * * * * * * */
  /* Phone: +358 40 765 5772, ICBM: N 60 10' E 24 55' */
 /* Mail: Mechelininkatu 26 B 27,  FI-00100 Helsinki */
/* * * Computers Rule 01001111 01001011 * * * * * * */

[toc] | [prev] | [next] | [standalone]


#163604

FromDozingDog@thekennel.co
Date2021-11-23 16:53 +0000
Message-ID<snj6ai$jkn$1@gioia.aioe.org>
In reply to#163591
On Tue, 23 Nov 2021 14:17:50 +0200
om@iki.fi (Otto J. Makela) wrote:
>Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>
>> "C Is The Greenest Programming Language" by: Chris Lott
>>    https://hackaday.com/2021/11/18/c-is-the-greenest-programming-language/
>
>Perhaps one contributing factor is that not so much development is any
>longer done using C or C++, and the programs that are run (and still
>being developed) were originally created in the era when CPU power was
>much lower than these days, so code optimization was more important.

Its good to see the attitude of just throw more CPU at something instead of
optimising it is still around. These days when server farms are taking up 
a siginificant percentage of the planet's electrical output its beholder on
programmers to make their code as efficient as is reasonable.

[toc] | [prev] | [next] | [standalone]


#163637

Fromom@iki.fi (Otto J. Makela)
Date2021-11-24 11:40 +0200
Message-ID<87mtlt99i1.fsf@tigger.extechop.net>
In reply to#163604
DozingDog@thekennel.co wrote:

> On Tue, 23 Nov 2021 14:17:50 +0200
> om@iki.fi (Otto J. Makela) wrote:
>>Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>
>>> "C Is The Greenest Programming Language" by: Chris Lott
>>>    https://hackaday.com/2021/11/18/c-is-the-greenest-programming-language/
>>
>>Perhaps one contributing factor is that not so much development is any
>>longer done using C or C++, and the programs that are run (and still
>>being developed) were originally created in the era when CPU power was
>>much lower than these days, so code optimization was more important.
>
> Its good to see the attitude of just throw more CPU at something
> instead of optimising it is still around. These days when server
> farms are taking up a siginificant percentage of the planet's
> electrical output its beholder on programmers to make their code
> as efficient as is reasonable.

I keep rereading that first sentence, is the meaning reversed?

-- 
   /* * * Otto J. Makela <om@iki.fi> * * * * * * * * * */
  /* Phone: +358 40 765 5772, ICBM: N 60 10' E 24 55' */
 /* Mail: Mechelininkatu 26 B 27,  FI-00100 Helsinki */
/* * * Computers Rule 01001111 01001011 * * * * * * */

[toc] | [prev] | [next] | [standalone]


#163650

FromDozingDog@thekennel.co
Date2021-11-24 15:49 +0000
Message-ID<snlmuo$ktp$1@gioia.aioe.org>
In reply to#163637
On Wed, 24 Nov 2021 11:40:54 +0200
om@iki.fi (Otto J. Makela) wrote:
>DozingDog@thekennel.co wrote:
>
>> On Tue, 23 Nov 2021 14:17:50 +0200
>> om@iki.fi (Otto J. Makela) wrote:
>>>Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>>
>>>> "C Is The Greenest Programming Language" by: Chris Lott
>>>>    https://hackaday.com/2021/11/18/c-is-the-greenest-programming-language/
>>>
>>>Perhaps one contributing factor is that not so much development is any
>>>longer done using C or C++, and the programs that are run (and still
>>>being developed) were originally created in the era when CPU power was
>>>much lower than these days, so code optimization was more important.
>>
>> Its good to see the attitude of just throw more CPU at something
>> instead of optimising it is still around. These days when server
>> farms are taking up a siginificant percentage of the planet's
>> electrical output its beholder on programmers to make their code
>> as efficient as is reasonable.
>
>I keep rereading that first sentence, is the meaning reversed?

No. 

[toc] | [prev] | [next] | [standalone]


Page 1 of 5  [1] 2 3 4 5  Next page →

Back to top | Article view | comp.lang.c


csiph-web