Wednesday, November 24, 2021

Digest for comp.lang.c++@googlegroups.com - 15 updates in 3 topics

Bonita Montero <Bonita.Montero@gmail.com>: Nov 24 06:32PM +0100

Am 24.11.2021 um 03:27 schrieb Richard Damon:
> to be reclaimed if/when the long lived object does go away.
 
> string_view doesn't help here, as when I create the few dynamic names,
> there is no place to keep that char array that is holding the name.
 
A class having a variant<string_view, string> member and an interface
to get or modify that string ? F.e. you could add a modify-interface
that does a copy-on-write modification of the string_view state,
chaning it into a string-state ?
Richard Damon <Richard@Damon-Family.org>: Nov 24 12:54PM -0500

On 11/24/21 12:32 PM, Bonita Montero wrote:
> to get or modify that string ? F.e. you could add a modify-interface
> that does a copy-on-write modification of the string_view state,
> chaning it into a string-state ?
 
Your getting very heavy now.
 
It was much simpler to just implement the version of string I wanted,
which kept a pointer to the data, and an allocation size.
 
When constructed from a char const* value, it checked if this pointer
was to the read only block of memory, and if so didn't copy that string,
but just kept the original pointer, with an allocated size of 0 (to make
it easy to see if it was a read only string or a writable).
 
If your use case doesn't fit what the library supports well, you can
make you own.
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Nov 24 10:14AM -0800

> the data for Go and Lisp in the paper:
 
> Go is fast (only 183% slower than C), but energy inefficient (323% more
> energy consumed than C).
 
What does "183% slower" mean? I presume it doesn't run backwards at 83%
of C's speed.
 
For that matter, does "323% more energy consumed" mean 3.23 times as
much energy or 4.23 times as much energy? (Consider that "10%" more
means "1.1 times as much.)
 
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */
David Brown <david.brown@hesbynett.no>: Nov 24 07:55PM +0100

On 24/11/2021 19:14, Keith Thompson wrote:
>> energy consumed than C).
 
> What does "183% slower" mean? I presume it doesn't run backwards at 83%
> of C's speed.
 
I would guess it means it takes 1.83 times as long to handle the same
basic task. I can't really see any logical alternative explanation.
But "183% slower" is not exactly a good way to express that!
 
> For that matter, does "323% more energy consumed" mean 3.23 times as
> much energy or 4.23 times as much energy? (Consider that "10%" more
> means "1.1 times as much.)
 
I would guess 3.32 times as much energy, based on similarity to my
interpretation of "183% slower". Again, I agree that it's a poor way to
express it.
 
Bonita Montero <Bonita.Montero@gmail.com>: Nov 24 08:52PM +0100

>> that does a copy-on-write modification of the string_view state,
>> chaning it into a string-state ?
 
> Your getting very heavy now.
 
Ok, developing a variant-string-class with all constructors,
methods and operators would be complex. But having s simple
variant<string, string_view> is easy.
Philipp Klaus Krause <pkk@spth.de>: Nov 24 09:11PM +0100

Am 24.11.21 um 19:14 schrieb Keith Thompson:
>> energy consumed than C).
 
> What does "183% slower" mean? I presume it doesn't run backwards at 83%
> of C's speed.
 
By "183% slower", I meant "takes 183% more time to execute", i.e. 2.83
times the execution time.
 
 
> For that matter, does "323% more energy consumed" mean 3.23 times as
> much energy or 4.23 times as much energy? (Consider that "10%" more
> means "1.1 times as much.)
 
That was a mistake, that should have been "223% more energy consumed",
i.e. 3.23 times the energy of the C program.
 
Philipp
Philipp Klaus Krause <pkk@spth.de>: Nov 24 09:13PM +0100

Am 24.11.21 um 19:55 schrieb David Brown:
> Again, I agree that it's a poor way to
> express it.
 
Yes. I should have written that differently.
Richard Damon <Richard@Damon-Family.org>: Nov 24 03:13PM -0500

On 11/24/21 2:52 PM, Bonita Montero wrote:
 
> Ok, developing a variant-string-class with all constructors,
> methods and operators would be complex. But having s simple
> variant<string, string_view> is easy.
 
Building a variant<string, string_view> may be easy but would be a HOG.
 
My variant-string class implement all the functionality I needed, and
none of the stuff I wanted, and saved a LOT of memory as the standard
string class include a LOT of virtual functions to do things I don't
need, and my implementation isn't smart enough to do the whole program
recompile to trim out unneeded virtual functions.
 
For 1 day of work I saves about 25% of my programs size becuase I could
drop all the locale support that I didn't need.
 
The first cut string version was to fix a program to big error for an
embedded system because std::string pulled in WAY too much code just to
exist.
 
The second cut added the const char* string optimization to save a lot
of ram.
 
Situation awareness is key here.
Philipp Klaus Krause <pkk@spth.de>: Nov 24 09:17PM +0100

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.
Bart <bc@freeuk.com>: Nov 24 08:42PM

On 24/11/2021 20:17, Philipp Klaus Krause wrote:
> 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.)
Lynn McGuire <lynnmcguire5@gmail.com>: Nov 24 03:28PM -0600

On 11/24/2021 3:33 AM, Otto J. Makela wrote:
 
>> I write C++ and Fortran code just about every day for our software
>> products.
 
> Do you consider this to be a common situation?
 
I really have no idea.
 
Lynn
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Nov 24 02:12PM -0800

On 11/22/2021 2:19 PM, Lynn McGuire wrote:
> 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...?
Philipp Klaus Krause <pkk@spth.de>: Nov 24 11:25PM +0100

Am 24.11.21 um 21:42 schrieb Bart:
 
>> 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).
Amine Moulay Ramdane <aminer68@gmail.com>: Nov 24 01:32PM -0800

Hello,
 
 
More of my philosophy about the multiple universes and time..
 
I am a white arab from Morocco, and i think i am smart since i have also
invented many scalable algorithms and algorithms..
 
I think i am smart, so as you are noticing from reading my thoughts below, that the multiple worlds or the multiple universes model
is also like greatly probable, since you have not to think time just residing in one world or universe, since this will make the understanding of relativity of time much more difficult, but when you think my model of time of the multiple worlds or multiple universes you will understand that the new world that is created, from the Gravity that curves space and time or the moving faster, can "shift" time, so this explains it much more clearly. Read my below previous thoughts of my philosophy about time so that to understand:
 
More of my philosophy about the multiple worlds and multiple universes and about time..
 
I think i am smart and i have just read the following article and i invite you to read it here:
 
What Is Time?
 
https://www.sciencealert.com/time
 
 
And notice that the article says the following about time:
 
--
"Two people moving at the same velocity will each agree their measures of distance and time match. As one person changes speed, however, they will see the other's measure of time and distance change, even as their own stays the same.
 
Without any reason to prioritize one perspective of time over another, this means time isn't a constant universal unit at all. It is a relative measurement that varies as objects move faster or slower, or as they're subjected to more or less gravity.
 
Gravity curves space and time: The stronger the gravity, the more it curves space-time, and the more time slows down."
--
 
So i think that what i am saying below about time is greatly probable,
since i think that there remains one important thing that i will say and it is that from my below thoughts of my philosophy about time, we can
say that there is like multiple worlds or universes that emerge when
Gravity curves space and time or the moving faster makes time becomes relative, so i think it is related to the subatomic layer, since when
Gravity curves space and time or the moving faster makes time relative, it is the subatomic layer that is changed and it composes again another
new world or universe that emerges that makes the time relative, and it is like the emergence of intelligence of an Ant colony, so read my previous thoughts so that to understand:
 
More of my philosophy about disorder and about God and more..
 
I think i am smart, and when you are naive you will quickly say that
God can not come from "disorder" like from where has come our universe,
but i will say that disorder is not a sufficient condition to make
God not exist, since in arabic we can say: "Hal min la' wujud ya'tina'
al wujud" , and its translation in english is: "Can from the not existent comes the existent ?", so as you are noticing that we can
for example say that the many other universes than our universe have always existed, and this can make us say that something other than those universes can have always existed, like the one that we call God.
 
More of my philosophy about the nature of our universe and the other universes..
 
I think i am smart, and i think that the nature of our universe is
that the lowest layer of the subatomic is also made of a kind of
"diversification", like in an Ant colony, and i think that this diversification comes from a kind of disorder from evolutive composition from the other universes that are disorder, but i think that there is a special thing to notice that for example the individual subatomic of time seems like made of disorder, but the composition of all the subatomic layer gives an emergence of order or intelligence like the time that we know it with its characteristic of being relative.
 
More of my philosophy about the distributed intelligence and more..
 
I think i am smart, so i think the intelligence of an Ant colony emerges from a "distributed" intelligence, so an individual Ant can be specialized like in our kind of civilization, but even if an Ant is specialized and he can be viewed as much less capable of constructing the intelligence of an Ant colony, the distributed intelligence of the Ant colony can make emerge the intelligence of an Ant colony, so i think that time is the same, the individual subatomic of time can be like more specialized, but all the subatomic layer can give emergence to time as we know it and to relativity of time.
 
More of my philosophy about what is time as we know it..
 
I think i am smart, and i think you know me much more now, and now
i will explain my point of view of what is time as we know it:
 
I think time that is relative as has said it Albert Einstein is an "emergence", so it is like an Ant colony, so if you look at an individual Ant in its colony you will like say that he is like disorder that will not be able to construct what constructs an Ant colony, so then the Ant colony is an "emergence" of intelligence, it is like the stomach of a human that is also an emergence of a kind of intelligence that knows how to process food, so i think time that is relative as has said it Einstein is also an "emergence", but when you look at time individually from the subatomic point of view you will like say that it is a disorder that can not construct the time that we know it, and it is by logical analogy like the example of the individual Ant above, but i think that the all subatomic layer has made "emerge" time as we know it, and it is like the emergence of intelligence of an Ant colony.
 
 
 
Thank you,
Amine Moulay Ramdane.
Amine Moulay Ramdane <aminer68@gmail.com>: Nov 24 12:57PM -0800

Hello,
 
 
More of my philosophy about the multiple worlds and multiple universes and about time..
 
I am a white arab from Morocco, and i think i am smart since i have also
invented many scalable algorithms and algorithms..
 
 
I think i am smart and i have just read the following article and i invite you to read it here:
 
What Is Time?
 
https://www.sciencealert.com/time
 
 
And notice that the article says the following about time:
 
--
"Two people moving at the same velocity will each agree their measures of distance and time match. As one person changes speed, however, they will see the other's measure of time and distance change, even as their own stays the same.
 
Without any reason to prioritize one perspective of time over another, this means time isn't a constant universal unit at all. It is a relative measurement that varies as objects move faster or slower, or as they're subjected to more or less gravity.
 
Gravity curves space and time: The stronger the gravity, the more it curves space-time, and the more time slows down."
--
 
So i think that what i am saying below about time is greatly probable,
since i think that there remains one important thing that i will say and it is that from my below thoughts of my philosophy about time, we can
say that there is like multiple worlds or universes that emerge when
Gravity curves space and time or the moving faster makes time becomes relative, so i think it is related to the subatomic layer, since when
Gravity curves space and time or the moving faster makes time relative, it is the subatomic layer that is changed and it composes again another
new world or universe that emerges that makes the time relative, and it is like the emergence of intelligence of an Ant colony, so read my previous thoughts so that to understand:
 
More of my philosophy about disorder and about God and more..
 
I think i am smart, and when you are naive you will quickly say that
God can not come from "disorder" like from where has come our universe,
but i will say that disorder is not a sufficient condition to make
God not exist, since in arabic we can say: "Hal min la' wujud ya'tina'
al wujud" , and its translation in english is: "Can from the not existent comes the existent ?", so as you are noticing that we can
for example say that the many other universes than our universe have always existed, and this can make us say that something other than those universes can have always existed, like the one that we call God.
 
More of my philosophy about the nature of our universe and the other universes..
 
I think i am smart, and i think that the nature of our universe is
that the lowest layer of the subatomic is also made of a kind of
"diversification", like in an Ant colony, and i think that this diversification comes from a kind of disorder from evolutive composition from the other universes that are disorder, but i think that there is a special thing to notice that for example the individual subatomic of time seems like made of disorder, but the composition of all the subatomic layer gives an emergence of order or intelligence like the time that we know it with its characteristic of being relative.
 
More of my philosophy about the distributed intelligence and more..
 
I think i am smart, so i think the intelligence of an Ant colony emerges from a "distributed" intelligence, so an individual Ant can be specialized like in our kind of civilization, but even if an Ant is specialized and he can be viewed as much less capable of constructing the intelligence of an Ant colony, the distributed intelligence of the Ant colony can make emerge the intelligence of an Ant colony, so i think that time is the same, the individual subatomic of time can be like more specialized, but all the subatomic layer can give emergence to time as we know it and to relativity of time.
 
More of my philosophy about what is time as we know it..
 
I think i am smart, and i think you know me much more now, and now
i will explain my point of view of what is time as we know it:
 
I think time that is relative as has said it Albert Einstein is an "emergence", so it is like an Ant colony, so if you look at an individual Ant in its colony you will like say that he is like disorder that will not be able to construct what constructs an Ant colony, so then the Ant colony is an "emergence" of intelligence, it is like the stomach of a human that is also an emergence of a kind of intelligence that knows how to process food, so i think time that is relative as has said it Einstein is also an "emergence", but when you look at time individually from the subatomic point of view you will like say that it is a disorder that can not construct the time that we know it, and it is by logical analogy like the example of the individual Ant above, but i think that the all subatomic layer has made "emerge" time as we know it, and it is like the emergence of intelligence of an Ant colony.
 
 
 
Thank you,
Amine Moulay Ramdane.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: