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


Groups > comp.lang.c++ > #82395 > 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 13 on this page of 93 — 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 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 Öö Tiib <ootiib@hot.ee> - 2021-11-24 05:54 -0800
        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 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-12-16 07:55 -0800
          Re: "C Is The Greenest Programming Language" by: Chris Lott legalize+jeeves@mail.xmission.com (Richard) - 2021-12-16 16:24 +0000
            Re: "C Is The Greenest Programming Language" by: Chris Lott Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-12-16 19:46 -0800
          Re: "C Is The Greenest Programming Language" by: Chris Lott Juha Nieminen <nospam@thanks.invalid> - 2021-12-17 06:30 +0000
            Re: "C Is The Greenest Programming Language" by: Chris Lott Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-12-18 07:45 -0800
              Re: "C Is The Greenest Programming Language" by: Chris Lott legalize+jeeves@mail.xmission.com (Richard) - 2021-12-30 12:01 +0000
                Re: "C Is The Greenest Programming Language" by: Chris Lott Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-01-16 12:22 -0800
                  Re: "C Is The Greenest Programming Language" by: Chris Lott legalize+jeeves@mail.xmission.com (Richard) - 2022-01-17 21:28 +0000
                    Re: "C Is The Greenest Programming Language" by: Chris Lott Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-01-17 15:48 -0800
                      Re: "C Is The Greenest Programming Language" by: Chris Lott legalize+jeeves@mail.xmission.com (Richard) - 2022-01-18 06:47 +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 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 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 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 Öö Tiib <ootiib@hot.ee> - 2021-11-24 06:03 -0800
        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" 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 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 5 of 5 — ← Prev page 1 2 3 4 [5]


#82464

FromPhilipp Klaus Krause <pkk@spth.de>
Date2021-11-24 21:17 +0100
Message-ID<snm6l8$r4e$1@solani.org>
In reply to#82443
Let's do this again:

When normalizing to the energy use and execution time of C (i.e. C is
1.0 for both energy use and execution time):

Go code takes 3.23 energy, and 2.83 execution time.

Lisp code takes 2.27 energy, and 3.40 execution time.

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


#82465

FromBart <bc@freeuk.com>
Date2021-11-24 20:42 +0000
Message-ID<snm835$1bb$1@dont-email.me>
In reply to#82464
On 24/11/2021 20:17, Philipp Klaus Krause wrote:
> Let's do this again:
> 
> When normalizing to the energy use and execution time of C (i.e. C is
> 1.0 for both energy use and execution time):
> 
> Go code takes 3.23 energy, and 2.83 execution time.
> 
> Lisp code takes 2.27 energy, and 3.40 execution time.
> 

Do you have direct links/locations to those figures?

The OP's PDF link seems to be making using the Shootout benchmarks, 
which I don't rate that highly.

There can be half a dozen different versions even in the same language, 
using different algorithms.

The actual tasks are dubious too; a benchmark based around one 
bottleneck is a long way from real code.

(Also, how did Lisp manage to be only 3 times as slow as C? It was both 
interpreted /and/ dynamically typed last I looked.)

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


#82470

FromPhilipp Klaus Krause <pkk@spth.de>
Date2021-11-24 23:25 +0100
Message-ID<snme4c$ur0$1@solani.org>
In reply to#82465
Am 24.11.21 um 21:42 schrieb Bart:
> On 24/11/2021 20:17, Philipp Klaus Krause wrote:
>> Let's do this again:
>>
>> When normalizing to the energy use and execution time of C (i.e. C is
>> 1.0 for both energy use and execution time):
>>
>> Go code takes 3.23 energy, and 2.83 execution time.
>>
>> Lisp code takes 2.27 energy, and 3.40 execution time.
>>
> 
> Do you have direct links/locations to those figures?

Table 4 in the paper at the link the OP gave
(https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf).

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


#82596

Fromantispam@math.uni.wroc.pl
Date2021-12-11 14:07 +0000
Message-ID<sp2bb2$5c1$1@z-news.wcss.wroc.pl>
In reply to#82465
In comp.lang.c Bart <bc@freeuk.com> wrote:
> 
> (Also, how did Lisp manage to be only 3 times as slow as C? It was both 
> interpreted /and/ dynamically typed last I looked.)

Lisp may be compiled to machine code and when speed is important
you will choose implementation with good compiler.  Concerning
"dynamically typed": Lisp has type declarations which are
optional.  Without declarations your types can be anything so
you get true dynamic typing.  With declarations you can declare
that your variable contains machine integers or doubles and
good Lisp compiler will generate directly machine code.

It is debatable how much C features contribute to speed of
resulting machine code.  In Lisp each data structure has
identifying header and you get efficient code only for arrays
of "primitive types", there is no way in Lisp to get something
with memory layout of C array of structs.  So in principle
in C you may have more compact data structures that keep
related items together, which leads to better cache use
and consequently less time spent on memory accesses.
When it comes to computations, it is mostly matter of
effort spent on compiler.  There was enormous effort spent
on C compilers and compilers like gcc are hard to beat.
Still, it depends on specific code: for simple code with
memory accesses that hit cache using Lisp I usually get about
half of speed of gcc-compiled C.  More tricky cases may be
somewhat slower.  For example I noted that Lisp compiler that
I use will use multiplication when sequentlially accessing
row of two dimensional array in a loop.  This lead to machine
code that is 4-5 times slower than code generated by gcc.
When code is memory-intensive (say pointer chaising) speed
is essentially indepenent of language (of course assuming
that language can express reasonanably efficient pattern
of memory accesses).

Looking at generated machine code I would expect that Lisp
will give me better or equal runtime speed compared to
your C compiler.

As little anecdote, I wrote code compiled via Lisp compiler
that was intended to be speed competivive with code in
interpreted language calling to optimized C libraries to
do main work.  AFAIK my code was faster, mainly because
I was able to create combined operation which saved essentally
half work compared to separate library calls.  That was
enough to compensate better code generator from C compiler.
Of course, coding my routine in C I would have both gain
form combined operation and gain from better compiler
optimization.  OTOH affected routines were about 60 lines
of code, while the whole thing was about 6000 lines.
Writing all in C would take _much_ more effort and the
result would be less useful as my routines were integrated
into existing program (which would be harder to do with
C code).

-- 
                              Waldek Hebisch

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


#82598

FromBart <bc@freeuk.com>
Date2021-12-11 18:46 +0000
Message-ID<sp2rm0$kls$1@dont-email.me>
In reply to#82596
On 11/12/2021 14:07, antispam@math.uni.wroc.pl wrote:
> In comp.lang.c Bart <bc@freeuk.com> wrote:
>>
>> (Also, how did Lisp manage to be only 3 times as slow as C? It was both
>> interpreted /and/ dynamically typed last I looked.)
> 
> Lisp may be compiled to machine code and when speed is important
> you will choose implementation with good compiler.  Concerning
> "dynamically typed": Lisp has type declarations which are
> optional.  Without declarations your types can be anything so
> you get true dynamic typing.  With declarations you can declare
> that your variable contains machine integers or doubles and
> good Lisp compiler will generate directly machine code.
> 
> It is debatable how much C features contribute to speed of
> resulting machine code.  In Lisp each data structure has
> identifying header and you get efficient code only for arrays
> of "primitive types", there is no way in Lisp to get something
> with memory layout of C array of structs.  So in principle
> in C you may have more compact data structures that keep
> related items together, which leads to better cache use
> and consequently less time spent on memory accesses.
> When it comes to computations, it is mostly matter of
> effort spent on compiler.  There was enormous effort spent
> on C compilers and compilers like gcc are hard to beat.
> Still, it depends on specific code: for simple code with
> memory accesses that hit cache using Lisp I usually get about
> half of speed of gcc-compiled C.  More tricky cases may be
> somewhat slower.  For example I noted that Lisp compiler that
> I use will use multiplication when sequentlially accessing
> row of two dimensional array in a loop.  This lead to machine
> code that is 4-5 times slower than code generated by gcc.
> When code is memory-intensive (say pointer chaising) speed
> is essentially indepenent of language (of course assuming
> that language can express reasonanably efficient pattern
> of memory accesses).
> 
> Looking at generated machine code I would expect that Lisp
> will give me better or equal runtime speed compared to
> your C compiler.

To me the most apt description of Lisp seems to be 'shape-shifting'.

The language is dynamically typed when it suits, but can switch to 
static typed when someone complains of the speed (but it needs someone 
to revise the program).

It also can be run-from-source, or it can compile to some interpreted 
internal form, or to native code (or, I guess, use some sort of JIT).

It also seems to be capable of anything; don't like how it does 
assignment; there several other ways it can pull out of the hat. That 
loop not powerful enough, there are half a dozen other forms with any 
number of parameters.

You just can't pin it down. And therefore it seems immune to any 
criticism; there is always a way to change it.

> As little anecdote, I wrote code compiled via Lisp compiler
> that was intended to be speed competivive with code in
> interpreted language calling to optimized C libraries to
> do main work.  AFAIK my code was faster, mainly because
> I was able to create combined operation which saved essentally
> half work compared to separate library calls.  That was
> enough to compensate better code generator from C compiler.
> Of course, coding my routine in C I would have both gain
> form combined operation and gain from better compiler
> optimization.  OTOH affected routines were about 60 lines
> of code, while the whole thing was about 6000 lines.
> Writing all in C would take _much_ more effort and the
> result would be less useful as my routines were integrated
> into existing program (which would be harder to do with
> C code).

I always reckoned that the right balance of dynamic code plus static 
code, should not be more than 1-2 times as slow as 100% static (save for 
programs with short runtimes)

And, sometimes, as you found, it can be a bit faster!

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


#82599 — [OT] Lisp. Was: "C Is The Greenest Programming Language" by: Chris Lott

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2021-12-11 20:11 +0000
Subject[OT] Lisp. Was: "C Is The Greenest Programming Language" by: Chris Lott
Message-ID<87h7begavu.fsf_-_@bsb.me.uk>
In reply to#82598
Bart <bc@freeuk.com> writes:

> To me the most apt description of Lisp seems to be 'shape-shifting'.
>
> The language is dynamically typed when it suits, but can switch to
> static typed when someone complains of the speed (but it needs someone
> to revise the program).

Handy that.  Rapid prototyping and robust production code.  It's the
same language though, you just use more if it as and when needed.

> It also can be run-from-source, or it can compile to some interpreted
> internal form, or to native code (or, I guess, use some sort of JIT).

Yes, there are a wide variety of implementations to suit different
needs.

> It also seems to be capable of anything;

It is.  That is obviously literally correct (Turing completeness and all
that) but modern Common Lisp is extraordinarily capable.

> don't like how it does assignment; there several other ways it can
> pull out of the hat. That loop not powerful enough, there are half a
> dozen other forms with any number of parameters.

There /is/ a lot to learn.  That's the perennial language design
dilemma.  You can have small and a bit rigid, or large and very
flexible.

> You just can't pin it down. And therefore it seems immune to any
> criticism; there is always a way to change it.

Actually it is pretty well pinned down.  There is a stable standard for
Common Lisp which is widely implemented and does not change half as much
as, say, the C standard.

-- 
Ben.

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


#82469

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2021-11-24 14:12 -0800
Message-ID<snmdbn$6vb$1@dont-email.me>
In reply to#82395
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."
> 

Humm... Perhaps, a main question can be, is there such a thing as a 
"green" programmer? One can write crappy and bloated code in C, that 
goes much slower than, say Python. However, one can write really 
efficient code in C... Therefore, the quality of a programmer seems to 
just want to come into play, so to speak...

Using undefined behavior wrt the standard can be a key aspect to writing 
faster, more efficient code. Possible scenario: This os has built-in 
User-space Read-Copy-Update (URCU). However, if I use it then my program 
is no longer portable...

Can things be greener with a talented programmer and a low-level 
language... Yes!

Can things be greener with a crappy programmer and a low-level 
language... Humm, No? By chance? Unknown...?

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


#82477

FromManfred <noname@add.invalid>
Date2021-11-25 12:00 +0100
Message-ID<snnqbn$1fj9$1@gioia.aioe.org>
In reply to#82469
On 11/24/2021 11:12 PM, Chris M. Thomasson wrote:
> 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."
>>
> 
> Humm... Perhaps, a main question can be, is there such a thing as a 
> "green" programmer? One can write crappy and bloated code in C, that 
> goes much slower than, say Python.

Everything is possible, but achieving that requires some specialized 
skillset(!)

  However, one can write really
> efficient code in C... Therefore, the quality of a programmer seems to 
> just want to come into play, so to speak...
> 
> Using undefined behavior wrt the standard can be a key aspect to writing 
> faster, more efficient code. Possible scenario: This os has built-in 
> User-space Read-Copy-Update (URCU). However, if I use it then my program 
> is no longer portable...
> 
> Can things be greener with a talented programmer and a low-level 
> language... Yes!
> 
> Can things be greener with a crappy programmer and a low-level 
> language... Humm, No? By chance? Unknown...?
> 

The issue is about idiomatic constructs, i.e. the mass of code running 
out there. I think that special circumstances and perverse cases do not 
really matter.
Even more considering that C code that is so bad as to manage to perform 
worse than some interpreted language is most likely pretty much 
unmaintainable too, so doomed to fast extinction in the digital ecosystem.

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


#82549

FromPaavo Helde <eesnimi@osa.pri.ee>
Date2021-12-05 22:51 +0200
Message-ID<soj8p4$ucr$1@dont-email.me>
In reply to#82395
23.11.2021 00:19 Lynn McGuire kirjutas:
> "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 

In my experience, any efforts towards more efficient software are easily 
defeated by users throwing more data to the program.

Wow, so you can fully analyze a 1024x1024 microscope image in less than 
a second! Wonderful, let's upgrade our hardware to take 2160x2160 images 
in the next version!

So, you managed to speed up the calculation time of morphological 
features by 50%. Fine, now we want to calculate 1000 features instead of 
the former 20!

Thus I'm afraid any hopes for a "green" programming language are at best 
naïve.

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


#82552

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2021-12-05 19:20 -0800
Message-ID<sojvid$bl1$1@dont-email.me>
In reply to#82549
On 12/5/2021 12:51 PM, Paavo Helde wrote:
> 23.11.2021 00:19 Lynn McGuire kirjutas:
>> "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 
> 
> In my experience, any efforts towards more efficient software are easily 
> defeated by users throwing more data to the program.
> 
> Wow, so you can fully analyze a 1024x1024 microscope image in less than 
> a second! Wonderful, let's upgrade our hardware to take 2160x2160 images 
> in the next version!
> 
> So, you managed to speed up the calculation time of morphological 
> features by 50%. Fine, now we want to calculate 1000 features instead of 
> the former 20!
> 
> Thus I'm afraid any hopes for a "green" programming language are at best 
> naïve.
> 

Fwiw, a hardcore blow up is when I have to render volumes. 256^3 fine, 
512^3 okay, 1024^3 slow, 2048^3 slow as shit...

4096^3 slower than a snail hiking up a mountain of salt!

Yikes!

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


#82558

FromManfred <noname@add.invalid>
Date2021-12-06 12:28 +0100
Message-ID<soks4h$1p94$1@gioia.aioe.org>
In reply to#82549
On 12/5/2021 9:51 PM, Paavo Helde wrote:
> 23.11.2021 00:19 Lynn McGuire kirjutas:
>> "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 
> 
> In my experience, any efforts towards more efficient software are easily 
> defeated by users throwing more data to the program.
> 
> Wow, so you can fully analyze a 1024x1024 microscope image in less than 
> a second! Wonderful, let's upgrade our hardware to take 2160x2160 images 
> in the next version!
> 
> So, you managed to speed up the calculation time of morphological 
> features by 50%. Fine, now we want to calculate 1000 features instead of 
> the former 20!
> 
> Thus I'm afraid any hopes for a "green" programming language are at best 
> naïve.
> 

True, but this doesn't make inefficient languages any better, does it?

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


#82559

FromPaavo Helde <eesnimi@osa.pri.ee>
Date2021-12-06 13:40 +0200
Message-ID<soksrm$drc$1@dont-email.me>
In reply to#82558
06.12.2021 13:28 Manfred kirjutas:
> On 12/5/2021 9:51 PM, Paavo Helde wrote:
>> 23.11.2021 00:19 Lynn McGuire kirjutas:
>>> "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 
>>
>> In my experience, any efforts towards more efficient software are 
>> easily defeated by users throwing more data to the program.
>>
>> Wow, so you can fully analyze a 1024x1024 microscope image in less 
>> than a second! Wonderful, let's upgrade our hardware to take 2160x2160 
>> images in the next version!
>>
>> So, you managed to speed up the calculation time of morphological 
>> features by 50%. Fine, now we want to calculate 1000 features instead 
>> of the former 20!
>>
>> Thus I'm afraid any hopes for a "green" programming language are at 
>> best naïve.
>>
> 
> True, but this doesn't make inefficient languages any better, does it?

No, it does not.

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


#82561

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-12-06 16:21 +0100
Message-ID<sol9q7$ekh$1@dont-email.me>
In reply to#82549
Am 05.12.2021 um 21:51 schrieb Paavo Helde:

> In my experience, any efforts towards more efficient software
> are easily defeated by users throwing more data to the program.

And that should determine the absolute possible efficiency of a 
programming language? I think not.

[toc] | [prev] | [standalone]


Page 5 of 5 — ← Prev page 1 2 3 4 [5]

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


csiph-web