Thursday, August 18, 2016

Digest for comp.lang.c++@googlegroups.com - 16 updates in 5 topics

red floyd <no.spam@its.invalid>: Aug 18 09:39AM -0700

Let us also not forget the fact that the toxic waste lines
run through the playground.
jacob navia <jacob@jacob.remcomp.fr>: Aug 18 07:26PM +0200

Le 18/08/2016 à 10:17, David Brown a écrit :
> Sites like this have a great tendency to talk about what "everyone
> knows" or what scientists "disagree" on. It is almost invariably nonsense.
 
Maybe.
 
Nonsense is to believe anybody knows how life started in this planet,
what life is, and what we are. Science has NO explanation for this
questions, our ignorance is a fact.
 
Yes, we believe that we will find eventually an explanation how the
genetic code arised, how *meaning* started in this part of the universe.
 
Some people let's call them "religious" people, say that they know the
answer (god did it) but actually they are worse off than the ones that
realize that they do not know!
 
I do not know who am I, nor do I know how life started. At least I know
that, I realize my ignorance. Because once you realize that, you can
start learning. Nobody can learn if he thinks he knows already everything.
 
The religious people have brought death and destruction to mankind since
ages. "My god is better than yours" yell the religions all across the
world. Some 3 000 gods in active existence today, and countless wars and
murders committed by the same gods.
 
Figments of a primitive mind, religions are a plague.
 
Abstracting from that and concentrating in the problems at hand, we see
history, i.e. evolution. We have been able to retrive the history of the
planet, the long story of life. But history is not an explanation.
 
It is a description of what happened.
 
We could be very well be the software constructs of some designer, since
we are almost able now to do the same thing.
 
In the near future, humans will start writing biological systems.
Bacteria are useful as universal machines, that can be programmed to
build stuff for us. Starting with the biological example, we will be
able to write a new genetic code, as some scientists are already
starting to do.
 
Then the question of how the hell this all started will be with us again
and again.
 
Will be ultimately able to construct a circuit that can realize that it
is living and start writing circuits of his own?
 
Surely such a circuit would be interesting for finding out the general
principles isn't it?
 
And before we start critizing the eye, as you do David, let's start
doing such a camera ok?
 
With a sensitivity of just a single photon? With a ridiculously low
amount of power?
 
True, humans do not see as well as flies or birds, because we do not
fly, as you can convince yourself, if you try, from a chair
 
:-)
 
But we have an incredible machine at our disposal. Not only the camera
but the circuit, David, the circuit between your ears.
 
Billions of processors running inn parallel, able not only to realize
its ignorance, but from there able to start LEARNING!
 
Science is learning David.
 
Our circuit is able to do that. Why? We do not know. But we are learning.
 
Religion is bad because it leads you into ignoring that you do not know,
actually, who you are. Ignorance is the ally of religion.
 
Learning is the only cure against religion.
 
jacob
David Brown <david.brown@hesbynett.no>: Aug 18 10:53PM +0200

On 18/08/16 19:26, jacob navia wrote:
 
> Nonsense is to believe anybody knows how life started in this planet,
> what life is, and what we are. Science has NO explanation for this
> questions, our ignorance is a fact.
 
Science has a good number of partial explanations for plausible ways for
life to start, but no complete hypotheses as yet. And of course we are
unlikely to ever know how life /did/ start - the best we can hope for is
ways that life /could/ have started.
 
But there is no doubt that there are plenty of things here that
scientists don't know. After all, if we knew all the answers, there
would be no need for more science! For scientists, ignorance is
something to be accepted, and embraced as a challenge - not something to
be denied or hidden.
 
 
> Yes, we believe that we will find eventually an explanation how the
> genetic code arised, how *meaning* started in this part of the universe.
 
Certainly we hope that we will find one (or more) plausible explanations
about how genetic code arose. As for how "meaning" started, that is, I
think, more philosophy than science. (Or do you mean "conciousness" or
"thought" here?)
 
 
> Some people let's call them "religious" people, say that they know the
> answer (god did it) but actually they are worse off than the ones that
> realize that they do not know!
 
Absolutely. Religious people, or at least /some/ religious people, feel
they already know the answer to everything. Life must be pretty boring
for them.
 
 
> I do not know who am I, nor do I know how life started. At least I know
> that, I realize my ignorance. Because once you realize that, you can
> start learning. Nobody can learn if he thinks he knows already everything.
 
Agreed. I don't know who you are either :-)
 
> ages. "My god is better than yours" yell the religions all across the
> world. Some 3 000 gods in active existence today, and countless wars and
> murders committed by the same gods.
 
It is human nature to fight. If people didn't fight each other over
religion, they would do so for other reasons. In fact, I think a good
many conflicts that appear to be religious are more about money, power,
land, or resources. So while many terrible things have been done, and
continue to be done, in the name of religion and "my god is better than
your god", they can't get /all/ the blame.
 
 
> It is a description of what happened.
 
> We could be very well be the software constructs of some designer, since
> we are almost able now to do the same thing.
 
It is certainly a possibility. The flaws and inefficiencies in biology
argue against a "designer" of some sort, at least at the level of the
life we see around us now. But the known facts and evidence don't rule
out the possibility that the earliest cells were designed, and the rest
of life is a science experiment left to run its course. As scientists,
we can't rule out any particular explanations - but we can look for more
"down to earth" explanations that fit with the rest of our scientific
theories.
 
> build stuff for us. Starting with the biological example, we will be
> able to write a new genetic code, as some scientists are already
> starting to do.
 
It is already being done, though the scale will no doubt increase.
 
> and again.
 
> Will be ultimately able to construct a circuit that can realize that it
> is living and start writing circuits of his own?
 
Self-conciousness is (as far as we know) an emergent property. It will
take a "circuit" of substantial complexity, but there is no reason for
it to be impossible.
 
> principles isn't it?
 
> And before we start critizing the eye, as you do David, let's start
> doing such a camera ok?
 
I don't have to be able to design a better eye before I can criticise
the existing human eye. And nature has already evolved significantly
better eyes than ours (at least, better for the purposes we now use them
for). However, if our distant ancestors' eyes had been as good as
birds' eyes, then they would not have evolved such complex brains to
compensate for the weaknesses of the eye - and perhaps then never have
evolved brains complex enough to become concious.
 
 
> :-)
 
> But we have an incredible machine at our disposal. Not only the camera
> but the circuit, David, the circuit between your ears.
 
Indeed, a large part of our rather impressive brain is devoted to
vision. So while birds vision centres are rather simple (in comparison)
because their eyes really can see colour, our vision centres are complex
so that - amongst other things - we have the illusion of seeing in
colour despite the physical limitations of the eye.
 
It really is a marvellous system - but it is not one that would come
about through design. If you tried to build a high resolution
electronic vision system, there are two ways to do it. You could use a
decent camera and lens along with a small processor and simple software
- or you could use a limited camera with a poor quality lens, and use
massive processing power and complex software algorithms to interpolate
over time and multiple images with digital filters to fill in the
missing details. Which would be the more sensible design, given a free
choice of parts?
 
jacobnavia <jacob@jacob.remcomp.fr>: Aug 18 11:49PM +0200

Le 18/08/2016 à 22:53, David Brown a écrit :
> over time and multiple images with digital filters to fill in the
> missing details. Which would be the more sensible design, given a free
> choice of parts?
 
Evolution tells us that some 60 million years ago we were a kind of rat.
 
That after the disparition of dinosaurs those rats started climbing to
the trees and stayed living there for millions of years.
 
But around six million years ago, a monkey had a fever, and a virus
entered its genome and a reorganization of many genes ensued. The brain
of the monkey started to grow as no other species experienced before.
New software was possible with that circuit. Cilindrical structures
appeared in the surface of the circuit, that increased in size.
 
In parallel, women evolved wider hips, to accomodate for a larger
circuit at birth.
 
I do not know how it happened, nor do I know definitely if that story is
lacking some essential pieces, but that is the primates story. Just
animals, like so many others and yet one day, they decided to walk upright.
 
So that they can see clearly the stars.
 
They developed the first invisible tool: a symbolic language.
 
SYMBOLS.
 
The genetic code is about SYMBOLS as all software. A sequence of three
DNA bases MEANS a specific amino-acid among the 20 that life uses to
build everything.
 
The sequence of proteins and enzyms is ENCODED in ADN with a code of 3
basepairs per amino-acid. There are START and STOP codons, and an
interpreter, the ribosome. The interpreter reads the code and emits at
the other side a growing chain that automatically folds in place.
 
The genetic code is the burst of MEANING (software) in this planet.
 
Consciousness is the evolution of that meaning to a conscious stage. We
are nature's latest innovation and one that has never existed before,
apparently.
 
Around four thousand million years life did not need nor evolved
consciousness. Until six million years ago and that monkey that started
acting up and walking upright so that the stars could be more easily
grasped.
 
Why?
 
I do not know. And when I think that it could be true that there is a
creator, it is not a "god" but that being that we all can see and taste
and smell and touch.
 
Life.
 
Life is a single being, and we are part of it. All life in earth uses
the same code, the same basic biochemistry, the same processes from
bacteria to man. Life is an impressive being, around 4 billion years
old. It covers all the surface of this planet, and probably goes deep
below, at least 4 Km deep you can still find bacteria and living things.
 
This being has changed the composition of the atmosphere of the planet
itself with his breathing, thriving on solar energy, chemical energy at
the depths of the ocean, chemical reactions in inhospitalable
environments. It can survive a meteor striking a global wound, survive
global disasters like the floods of lava, hundreds of millions of years
ago. Life is a VERY tough being.
 
Does this being have a consciousness, could we communicate with the
whole of life in this planet?
 
I do not think so, such a being is so incredible different than me, a
mere human, that I have no idea how I could tell him something, even if
such a thing as ideas and concepts would mean anything to it.
 
But one thing I am sure: it is not god. It is not invisible, and we eat
parts of its body every day, we breathe the oxygen the plants produce
every day, we are connected to it by zillions of bacteria that live in
our skin and guts, by our total dependence on other kinds of life to
just survive.
 
Life doesn't exist anywhere else but in the context of this being.
 
Is it possible to speak about a single being?
 
Yes, it is. I repeat:
 
o The same genetic code in all beings
o The same biochemical processes like respiration, (mitochondria),
digestion, and the same 20 amino-acids that build our flesh, the
plants, the dogs, the amoeba, everything. Just the SAME 20 building blocks!
 
Please do not confuse LIFE with the gods we create at our own image.
 
Life is nothing like that, we do not have any information on its
purpose, why some species appear, why they are discontinued and disappear.
 
We, do not know either what really happened to those monkeys 6 million
years ago, but the descendants of those monkeys today do wonder...
 
Why?
 
It was a "random mutation" somewhere?
 
I am skeptic about random process. They surely have a place in living
beings, as a source of diversity, but always in a very controlled manner.
 
And I am more and more fascinated by the growing similarities between
software environments and the maintenance of the genetic code/programs
that organisms use.
 
Did you know that some species encrypt their genome?
 
A species of viruses has many times the size of our own genetic program.
Thousands and thousands of genes are stored in the genome of those
viruses in something that looks more and more like a living data-base!
 
We have text editors, and we should be grateful because without them we
would be dead in a few years. Text editors discover errors in
transcription and correct them. Genes are stored in different kind of
storage spaces: Packed, semi-opened and ready.
 
They are ANNOTATED with COMMENTARIES (methyl groups added to the DNA
code at specific places) that determine if they are to be used or not at
all. This is a new discovery (the annoations) that has been done
relatively recently and grasped in its full significance only since a
few years.
 
Since those annotations are transmitted from mother to child, it is a
new kind of inheritance: the commentaries.
 
A new being is started with most commentaries in the virgin state, but
the mother and the father let pass some of those.
 
There is a whole new world of software there, where life opens up her
books for us.
 
LITERALLY.
 
She shows us the book of life base after base, gen after gen, organism
after organism.
 
We just have to learn to read.
 
I do not believe in a god but I am sure that life exists.
 
jacob
jacob navia <jacob@jacob.remcomp.fr>: Aug 14 09:35PM +0200

Le 14/08/2016 à 17:32, Mr Flibble a écrit :
> C++ is a complicated language? No shit. Have you only just realized this?
 
No, since quite a long time actually.
 
> C++ was complicated before C++98 so imagine how complicated it is now.
 
I do not need to imagine it. Just look at it.
 
> However, paradoxically, C++'s complexity can result in simpler C++
> PROGRAMS which is a GOOD THING (tm).
 
Yes, but the problem is brittleness. Without continuous maintenance any
small thing that changes and unrelated code to the point of failure
could go wrong.
 
Finding the point of failure becomes extremely complex for the unaware
maintenance programmer.
 
For instance (in another message) you say that
 
<quote>
My new GUI library "neoGFX" doesn't use signals and slots as signals and
slots are an old solution to an old problem. Instead all we need to do is:
 
button1.clicked([](){...});
 
<end quote>
 
Are you sure? The new syntax does really replace neatly the code for
slots/signals? An object (a button) that sends signals was an analogy
quite easy to follow.
 
What does the new syntax bring to the code actually? Because apart for
being very small, it looks very unreadable to me.
 
Of course I am not a C++ head but I would prefer the old slot/signal
framework. It is a proven analogy, many libraries use it, and code
written like that has a KNOWN structure, callbacks, etc. Yours is a new
way of doing the same thing, what can be very clever but for the
maintenance programmer is yet another pain in the ass really.
 
Sorry but I couldn't resist
 
:-)
 
 
 
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Aug 14 04:32PM +0100

C++ is a complicated language? No shit. Have you only just realized this?
 
C++ was complicated before C++98 so imagine how complicated it is now.
 
However, paradoxically, C++'s complexity can result in simpler C++
PROGRAMS which is a GOOD THING (tm).
 
/Flibble
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Aug 14 10:01PM +0100

On 14/08/2016 21:39, jacob navia wrote:
 
> WHAT IS THE ADANTAGE of the new syntax in terms of software engineering?
 
> (Besides being more incomprehensible)
 
> Thanks in advance for your explanations.
 
My solution with lambdas is actually simpler than signals and slots.
 
I can only repeat my earlier reply: if you find C++ lambdas too
complicated then I suggest you use a different programming language.
 
/Flibble
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Aug 14 02:51PM +0100

On 14/08/2016 14:26, Alf P. Steinbach wrote:
> compilers say about it:
 
> struct S{ int x; };
 
> auto main() -> int
 
Do you realize how demented that looks? Take your meds and write:
 
int main()
 
like any sane person would.
 
>> _
> </compilation>
 
> Oh my, they disagree!
 
Intel's compiler also allows the assignment.
 
 
> What do you think the standard says about it?
 
According to the Standard it is an rvalue however it also has a *name*.
 
/Flibble
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Aug 14 02:57PM +0100

leigh@server:~$ cat test.cpp
struct s
{
int n;
};
 
int main()
{
constexpr int z1 = 0;
const int z2 = 0;
int z3 = 0;
void* p0 = 0;
void* p1 = z1;
void* p2 = z2;
void* p3 = z3;
void* p4 = s().n;
}
leigh@server:~$ g++ -std=c++11 test.cpp
test.cpp: In function 'int main()':
test.cpp:12:13: error: invalid conversion from 'int' to 'void*'
[-fpermissive]
void* p1 = z1;
^
test.cpp:13:13: error: invalid conversion from 'int' to 'void*'
[-fpermissive]
void* p2 = z2;
^
test.cpp:14:13: error: invalid conversion from 'int' to 'void*'
[-fpermissive]
void* p3 = z3;
^
test.cpp:15:17: error: invalid conversion from 'int' to 'void*'
[-fpermissive]
void* p4 = s().n;
^
leigh@server:~$ clang -std=c++11 test.cpp
test.cpp:12:8: error: cannot initialize a variable of type 'void *' with an
lvalue of type 'const int'
void* p1 = z1;
^ ~~
test.cpp:13:8: error: cannot initialize a variable of type 'void *' with an
lvalue of type 'const int'
void* p2 = z2;
^ ~~
test.cpp:14:8: error: cannot initialize a variable of type 'void *' with an
lvalue of type 'int'
void* p3 = z3;
^ ~~
test.cpp:15:8: error: cannot initialize a variable of type 'void *' with an
rvalue of type 'int'
void* p4 = s().n;
^ ~~~~~
4 errors generated.
leigh@server:~$
 
/Flibble
Ian Collins <ian-news@hotmail.com>: Aug 15 07:23AM +1200

On 08/15/16 03:23 AM, Manfred wrote:
> appear not to be irrelevant (my gcc always outputs X! by the way), this
> confirms the complexity of the language, IMHO. Meaning that the original
> cleanliness of the language risks to get polluted by newer "improvements"
 
Which compilers are they?
 
--
Ian
jacob navia <jacob@jacob.remcomp.fr>: Aug 14 07:06PM +0200

Le 14/08/2016 à 17:23, Manfred a écrit :
> this confirms the complexity of the language, IMHO. Meaning that the
> original cleanliness of the language risks to get polluted by newer
> "improvements"
 
Exactly the point I am trying to make.
 
Interactions between each new "feature" with old features, added to
things that were already wrong (the ambiguity between 0 as an integer
and 0 as a null pointer) that weren't fixed but now reachy new places
where they can bite the unaware.
 
What I want to say is this:
 
C++ is reaching the point where only a machine can follow the extremely
complex rule's interaction.
 
Programmers can't follow and when they use the language they CAN'T
foresee exactly what will happen.
 
The example I gave is just 12 lines of C++!
 
It is not the sheer size of the example, it is just that humans can't
follow the rules!
 
jacob
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Aug 14 09:55PM +0100

On Sun, 14 Aug 2016 22:52:02 +0200
> [drivel snipped]
 
You are still missing the point. Your example is highly artificial.
No one in their right minds would write code of that kind for a
meaningful purpose, and I am certainly not going to spend the time
reaching a view about which of the views expressed is correct.
jacob navia <jacob@jacob.remcomp.fr>: Aug 14 11:08PM +0200

Le 14/08/2016 à 22:55, Chris Vine a écrit :
> jacob navia <jacob@jacob.remcomp.fr> wrote:
>> [drivel snipped]
 
> You are still missing the point. Your example is highly artificial.
 
 
Of course not!!!!!!!
 
That is a condensate of a problem that will appear in a huge program
where conceptually those 12 lines are dispersed in several different
files across several classes and templates and what have you!!!!!
 
> No one in their right minds would write code of that kind for a
> meaningful purpose,
 
THAT IS A MINIMAL EXAMPLE OF THE PROBLEM MAN!
 
Please turn on the brain before posting!
 
 
A "minimal example" in compiler parlance, is a very small code snippet
that highlights a problem that could be dispersed in several different
locations!
 
> and I am certainly not going to spend the time
> reaching a view about which of the views expressed is correct.
 
Of course not. If you do not feel like not doing it do not do it!
 
But then just keep silent since you have nothing to say and the only
thing that you can say is that I am just speaking
 
"drivel"
 
that can be ignored, without engaging a single argument or technical point
ram@zedat.fu-berlin.de (Stefan Ram): Aug 14 03:26PM

> lhs += x;
> return std::move(lhs);
>}
 
You have an object as a return value and then move into
this object. lhs is an lvalue, not an xvalue, so RVO might
not move from it without the move as far as I understand it.
 
I have no experience in this field. But the class
Signalsource could get methode to return its resources
and bring the object into a valid but resourceless state
and an implicit constructor to build a SignalSource from
this.
 
return lhs.resources();
 
Then the returned object would be built from those resources.
bitrex <bitrex@de.lete.earthlink.net>: Aug 14 06:33PM -0400

On 08/14/2016 05:27 PM, Öö Tiib wrote:
> efficiency where needed. There were no rvalue-references (from what it
> is safe to move or to swap) so if someone wanted to move from reference
> to temporary then he had to cast constness away.
 
Nice, thank you for your insight. I've started using C++11 a bit on the
desktop and the unique_ptr smart pointer syntax does make life a lot
easier.
 
Unfortunately this particular thing is for an embedded platform, so all
that cool automatic memory management stuff that assumes a system MMU is
out the door.
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Aug 14 11:58PM +0200

On 14.08.2016 17:11, bitrex wrote:
> rhs += x;
> return std::move(rhs);
> }
 
I think this is probably not your actual code. Your actual code is
probably templated on SignalSource, in which case the && is a universal
reference. In the non-templated code given above, && is an rvalue
reference, which would only permit rvalue expression as actual argument.
 
Anyway, you can either
 
• remove the move optimization (just copy things) or
 
• implement /explicit/ move operations.
 
 
> of objects on the stack when the source/destination is going to be
> destroyed anyway, so I didn't know if there was some "canonical" way to
> backport this.
 
Nope, but if, after measuring the simple copy solution, you find that
moving is really required, then instead of implementing your own
explicit C++03 move operations you could look up Andrei Alexandrescu's
Mojo article in DDJ.
 
 
Cheers & hth.,
 
- Alf
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: