Saturday, May 2, 2020

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

Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: May 03 12:09AM +0100

Hi!
 
neoGFX has two modes of operation: green and turbo. In green mode CPU usage is close to 0% and GPU rendering only happens if things change. In turbo mode FPS limits are turned off as can be seen in this screenshot. #neoGFX #gamedev #cpp #coding #ClimateAction
 
https://neogfx.org/temp/turbo_mode.png
 
That is all!
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin
 
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: May 02 02:41AM +0100

On 01/05/2020 17:45, red floyd wrote:
> time.
 
> Any opinions on the level of effort for a "proper" 03 => 11 transition?
> Suggestions, etc, are also welcome.
 
Use C++17.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin
 
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."
red floyd <no.spam@its.invalid>: May 01 08:15PM -0700

On 5/1/20 6:41 PM, Mr Flibble wrote:
 
> Use C++17.
 
> /Flibble
 
What part of "only a C++11 and C++03 compiler are available" do you have
a problem understanding?
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: May 02 07:11AM +0200

On 02.05.2020 05:15, red floyd wrote:
 
>> /Flibble
 
> What part of "only a C++11 and C++03 compiler are available" do you have
> a problem understanding?
 
It reminds me of the Eiffel approach of compiling to C as an
intermediate language.
 
After all C was /made for the purpose/ as a high level assembly
language, to ease the porting of early Unix.
 
Build times for C++ being what they are in 2020 it's probably not on as
a practical proposition, but it could bring the advantages of each new
C++ standard to even the most backward platforms, in essence
cross-compiling to that platform's main C language implementation.
 
And it's been done before. CFront, Bjarne's first compiler, emitted C
code. The Comeau compiler, that 15+ years ago (not sure about dates) we
used to check code correctness, like a reference implementation of the
language, likewise could compile to C.
 
Some people, e.g. I found some SO questions about it, assert that one
can use LLVM to translate C++ to equivalent C.
 
 
- Alf
Ian Collins <ian-news@hotmail.com>: May 02 06:13PM +1200

On 02/05/2020 04:45, red floyd wrote:
> time.
 
> Any opinions on the level of effort for a "proper" 03 => 11 transition?
> Suggestions, etc, are also welcome.
 
We went through this process a few years back and it wasn't too big a
deal. Your C++03 should continue to build with c++11. For the library
improvements in C++11, you can generally use boost in C++03 code and
simply swap boost to std when you upgrade. If I look back in our git,
there are a ton of "de-boosting" commits :)
 
 
As someone else said, make sure to avoid auto_ptr!
 
--
Ian.
Jorgen Grahn <grahn+nntp@snipabacken.se>: May 02 06:15AM

On Fri, 2020-05-01, red floyd wrote:
> reasons, and then because of the high coupling factor from the patches,
> it was really impossible to have an automated unit test suite. By
> refactoring on this scale, we can write the unit tests as we go.
 
It's orthogonal though, isn't it? Unit tests won't be that helpful in
keeping the software's behavior the same after the porting, since it
tests interfaces you're replacing. I'd be more interested in
(automated) tests on the whole system, and/or on components.
 
Of course unit tests have other benefits.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Sam <sam@email-scan.com>: May 02 07:16AM -0400

red floyd writes:
 
> Any opinions on the level of effort for a "proper" 03 => 11 transition?
> Suggestions, etc, are also welcome.
 
Could be anything, from minimal to massive. This assumes on whoever is
working on it is thoroughly familiar with C++11 language features and is
capable of employing them where needed, of course.
 
Strangers on the intertubes who have never seen your code have no way of
being more precise than that.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: May 02 02:01PM +0100

On 02/05/2020 04:15, red floyd wrote:
 
>> /Flibble
 
> What part of "only a C++11 and C++03 compiler are available" do you have
> a problem understanding?
 
My answer remains unchanged, use C++17, and by that I mean your reasoning that "that is what you have to work with" is bogus: make changes so that you can use C++17.
 
Use C++17.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin
 
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."
red floyd <no.spam@its.invalid>: May 02 11:27AM -0700

On 5/2/20 6:01 AM, Mr Flibble wrote:
> reasoning that "that is what you have to work with" is bogus: make
> changes so that you can use C++17.
 
> Use C++17.
 
OK, let's assume I use C++17. How do you propose I compile it? I
cannot change platforms. I'm all ears. Only the vendor provided
compilers are available, there is no g++.
red floyd <no.spam@its.invalid>: May 02 11:28AM -0700

On 5/2/20 11:27 AM, red floyd wrote:
 
> OK, let's assume I use C++17.   How do you propose I compile it?   I
> cannot change platforms.  I'm all ears.  Only the vendor provided
> compilers are available, there is no g++.
 
I mean, if you can't give me an answer here to my "how do you propose"
question, your answer is simply sausages.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: May 02 09:35PM +0100

On 02/05/2020 19:28, red floyd wrote:
>> compilers are available, there is no g++.
 
> I mean, if you can't give me an answer here to my "how do you propose"
> question, your answer is simply sausages.
 
My answer is simple: change things so you can use a C++17 compiler.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin
 
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."
red floyd <no.spam@its.invalid>: May 02 02:12PM -0700

On 5/2/20 1:35 PM, Mr Flibble wrote:
 
>> I mean, if you can't give me an answer here to my "how do you propose"
>> question, your answer is simply sausages.
 
> My answer is simple: change things so you can use a C++17 compiler.
 
Thanks for nothing. I do not have the option to change the platform.
You must be lovely to work with.
 
Your advice is sausages.
Juha Nieminen <nospam@thanks.invalid>: Apr 24 06:13AM

>> quickly porting this from C over to C++, and it slipped my mind. ;^o
 
> I forgot <cmath> as well. Missed it when everything compiled right up
> with just <complex>. double damn! ;^o
 
While you are at it, maybe change the calloc() to a std::vector?
Much simpler, and shouldn't have much of an impact on performance.
Juha Nieminen <nospam@thanks.invalid>: Apr 25 05:04PM

> Certainly it is not the case that 99% of C programs are valid C++
> programs. That number is closer to 0%.
 
Can you explain why? I can't immediately think of a reason why no
C program would be valid C++ without modification (especially now
that the standardization committee decided that standard headers
inherited from C with names in the form of <name.h> are valid and
will put everything in the global namespace.)
Jorgen Grahn <grahn+nntp@snipabacken.se>: Apr 25 06:36PM

On Sat, 2020-04-25, Juha Nieminen wrote:
> that the standardization committee decided that standard headers
> inherited from C with names in the form of <name.h> are valid and
> will put everything in the global namespace.)
 
I'm more interested in why people /care/. This topic generates a lot
of heat, over and over again ... but as I see it, pretty much
everyone[0] has a C compiler and a C++ compiler, and will compile
their C code with the former and their C++ code with the latter.
 
The ability to use C libraries from C++ (without any glue) matters
though.
 
/Jorgen
 
[0] Not everyone.
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Tim Rentsch <tr.17687@z991.linuxsc.com>: Apr 24 06:37AM -0700

>> There is no such language in existence
 
> in practice something like 99% of C is valid C++ as-is, without
> modification.
 
It may be that 99% of C constructs are valid C++ as is.
 
Certainly it is not the case that 99% of C programs are valid C++
programs. That number is closer to 0%.
James Kuyper <jameskuyper@alumni.caltech.edu>: Apr 26 12:25AM -0400

On 4/25/20 11:01 PM, Alf P. Steinbach wrote:
...
> Even more unlikely, that someone would use complex numbers in C.
 
<https://searchcode.com/?q=%22%3Ccomplex.h%3E%22&lan=28>
Tim Rentsch <tr.17687@z991.linuxsc.com>: Apr 24 06:40AM -0700


> But C and C++ are very related languages, so there IS a language family
> that can be described as C/C++, and there is a common core that is
> common between the two languages. [...]
 
Already too small to be practicable in any serious project,
and getting smaller by the hour.
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: May 02 04:53AM +0200

On 01.05.2020 18:24, David Brown wrote:
> object definitions (whether const or not) in a header without needing an
> accompanying .cpp file or playing tricks with templated functions with
> static variables.
 
On the one hand it's good that the committee finally addressed the
inconsistency in the syntactical support for functions versus objects.
 
On the other hand I see it as ungood that they continued using the
keyword `inline` for this, because there is massive evidence that it
misleads.
 
It misleads not just beginners but also professionals with years of
experience.
 
 
- Alf
Juha Nieminen <nospam@thanks.invalid>: May 02 06:09AM

> misleads.
 
> It misleads not just beginners but also professionals with years of
> experience.
 
Indeed. Every time I say "inline is a command for the linker, it has
nothing to do with actual inlining", someone will object.
David Brown <david.brown@hesbynett.no>: May 02 01:02PM +0200

On 02/05/2020 08:09, Juha Nieminen wrote:
>> experience.
 
> Indeed. Every time I say "inline is a command for the linker, it has
> nothing to do with actual inlining", someone will object.
 
However, "inline variables" are consistent with "inline functions".
It's a poor choice of keyword (though it made sense historically), but
at least it is consistent - and at least it is not another overload of
"static" :-)
red floyd <no.spam@its.invalid>: Apr 25 01:36PM -0700


> Don't swear here, please.
 
> I didn't vote for Clinton, Bush, Obama, Hillary or Trump.
> I've been voting for the Constitution Party candidates.
 
Fuck off trying to impose your morals on everyone else.
Ian Collins <ian-news@hotmail.com>: Apr 25 12:54PM +1200

On 24/04/2020 19:21, David Brown wrote:
> and has been predicted to replace them for nearly 10 years, but is still
> seen almost nowhere. Just as IPv6 is only found either on specialised
> or highly technical local networks, ...
 
Or in India and Japan!
 
--
Ian.
Cholo Lennon <chololennon@hotmail.com>: Apr 24 02:07PM -0300

On 23/4/20 10:54, David Brown wrote:
 
> (I know of a couple of C compilers where the size of "int" can be
> changed from the command line, but these won't be of concern to most
> people.)
 
I was reading something related today...
 
"LLVM Clang compiler adds support for custom width integers"
https://www.theregister.co.uk/2020/04/24/llvm_project_adds_support_for/
 
 
--
Cholo Lennon
Bs.As.
ARG
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: