Tuesday, August 1, 2017

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

woodbrian77@gmail.com: Aug 01 10:01AM -0700

On Tuesday, August 1, 2017 at 3:29:29 AM UTC-5, David Brown wrote:
 
> I thought the point of Brian's stuff was that it was an online code
> generator? Surely that means there must be a way to generate code
> online to see it?
 
I started off with a web interface in 2002. In 2003, I
visited Bjarne Stroustrup at Texas A&M and gave him a
demo. One of his comments was about putting code under
people's nose's. After you clicked 'submit' on the web
interface, it would come back with code on the screen.
So that's what he was referring to. It took a number of
years (2009) before I was able to get to the command
line interface that I have today. The CLI is more
amenable to automation and build integration than the
web interface was. Would it be nice to still have the
web interface? Yes, but there's a cost to maintaining it.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
David Brown <david.brown@hesbynett.no>: Aug 01 08:33PM +0200

> amenable to automation and build integration than the
> web interface was. Would it be nice to still have the
> web interface? Yes, but there's a cost to maintaining it.
 
For the record, I much prefer stand-alone code generators to online
ones. But you regularly write things like "Anyone who thinks on-line
code generation is not here to stay needs counseling" with an almost
total disregard for context or the topic of the thread. Your posts
extolling the virtues of on-line code generation are almost as common as
your posts complaining about swearing. However, it seems that you don't
have any sort of online code generation. Is that right?
 
(I have no use of or interest in your software - it is simply not the
sort of thing I need or want. So I have not looked at it in detail.)
"Öö Tiib" <ootiib@hot.ee>: Aug 01 12:13PM -0700


> Have you tried my example programs
> https://github.com/Ebenezer-group/onwards/tree/master/example
> ? An account is not needed to run those.
 
No. Why to run those? I won't.
 
> Run:
 
> make example
 
> to get them to build.
 
Are you joking?
It does not definitely count as trying online tools or code generators
by any standards. There are neither web nor command line interfaces
anywhere.
woodbrian77@gmail.com: Aug 01 12:51PM -0700

On Tuesday, August 1, 2017 at 1:33:21 PM UTC-5, David Brown wrote:
> your posts complaining about swearing.
 
> However, it seems that you don't
> have any sort of online code generation. Is that right?
 
Whether you use a web interface or a command line interface,
doesn't make a difference in terms of the end result.
But a web interface isn't easy to automate. Hence the
need for a command line interface. Another way to talk
about it is that the C++ Middleware Writer is a hosted
code generator. The old way, that you prefer, means
maintaining your installation with patches and reinstalling
from time to time. It gets more complicated if you want
to have multiple instances of an app (e.g. compiler) on a
machine.
 
The Amish people who helped build the replica of Noah's
Ark in Kentucky have skipped a lot of the tech stuff.
So I understand if you prefer to do so in this case also.
We can only hope to attain to the quality that the Amish
do with whatever technology we decide to use.
 
 
 
Brian
Ebenezer Enterprises - In G-d we trust.
http://webEbenezer.net
Vir Campestris <vir.campestris@invalid.invalid>: Aug 01 09:14PM +0100

> Another way to talk
> about it is that the C++ Middleware Writer is a hosted
> code generator.
 
I've never got around to investigating it - but just FYI I don't think
any of my employers, past or present, would countenance putting their
private information out on a 3rd party's web site. Which would stop this
cold.
 
(And no, they didn't use gmail)
 
Andy
woodbrian77@gmail.com: Aug 01 01:18PM -0700

On Tuesday, August 1, 2017 at 2:14:12 PM UTC-5, Öö Tiib wrote:
> > https://github.com/Ebenezer-group/onwards/tree/master/example
> > ? An account is not needed to run those.
 
> No. Why to run those? I won't.
 
Well, you did say you "like to try stuff."
 
 
> Are you joking?
> It does not definitely count as trying online tools or code generators
> by any standards.
 
It's testing some code that has been written by a
code generator. Sorry, I didn't maintain the web
interface to the C++ Middleware Writer. But like
Bjarne, you could have tested it that way up until
2009. Now the only way is via the command line
interface. I'm happy to help anyone get started
with it.
 
> There are neither web nor command line interfaces
> anywhere.
 
The command line interface is here:
https://github.com/Ebenezer-group/onwards
 
You can clone or download the code and build it.
On my slowest machine, it takes less than 3 seconds
to build.
 
 
Brian
Ebenezer Enterprises
David Brown <david.brown@hesbynett.no>: Aug 01 10:32PM +0200

> from time to time. It gets more complicated if you want
> to have multiple instances of an app (e.g. compiler) on a
> machine.
 
And that is the way it should be. If I have a project that has some
sort of code generator to take the "real source" and produce the C or
C++ code, then that generator is part of the project. To a good enough
build system for me, I have to be able to take the old project, rebuild
it all (including re-generating any generated stuff), and get a
bit-perfect identical binary. Anything less means a disaster of
re-testing and re-qualification. This means that once a project is
done, the generator does not get patched, updated, or changed unless
there is a major new version of the whole project.
woodbrian77@gmail.com: Aug 01 01:40PM -0700

On Tuesday, August 1, 2017 at 3:15:10 PM UTC-5, Vir Campestris wrote:
> any of my employers, past or present, would countenance putting their
> private information out on a 3rd party's web site. Which would stop this
> cold.
 
Companies are free to license the software and
maintain it at their location if they want.
 
Individuals and companies that are comfortable with
using the version we host though, will get the better
deal in my opinion -- free to use and easier for us to
help them figure out any problems.
 
And it's not like you have to release all your code
or even a large part of it in order to use this.
 
 
Brian
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Aug 01 01:05PM -0400

On 8/1/2017 11:34 AM, Scott Lurndal wrote:
> The algorithms on the bithacks page are much more space and
> time efficient that your algorithm.
 
I took a look at those algorithms. Which one(s) would you suggest for
use on the bit-scan forward and reverse algorithms?
 
http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightLinear
 
Is it the ZerosOnRightLinear algorithm? It yields this code:
 
27: // unsigned int v; // input to count trailing zero bits
28: int c; // output: c will count v's trailing zero bits,
29: // so if v is 1101000 (base 2), then c will be 3
30:
31:
32: if (v)
00C71000 8B 44 24 04 mov eax,dword ptr [v]
00C71004 85 C0 test eax,eax
00C71006 74 14 je testme+1Ch (0C7101Ch)
33: {
34: v = (v ^ (v - 1)) >> 1; // Set v's trailing 0s
// to 1s and zero rest
00C71008 8D 48 FF lea ecx,[eax-1]
00C7100B 33 C8 xor ecx,eax
35: for (c = 0; v; c++)
00C7100D B8 00 00 00 00 mov eax,0
00C71012 D1 E9 shr ecx,1
00C71014 74 0B je testme+21h (0C71021h)
00C71016 40 inc eax
36: v >>= 1;
00C71017 D1 E9 shr ecx,1
00C71019 75 FB jne testme+16h (0C71016h)
43: }
00C7101B C3 ret
37:
38: } else {
39: c = CHAR_BIT * sizeof(v);
00C7101C B8 20 00 00 00 mov eax,20h
40: }
41:
42: return(c);
00C71021 C3 ret
 
That code has multiple branches within it for the for-loop. It also
has two branch dependencies based on bitwise shift operations.
 
I don't know if it would be more efficient than the code I had,
though it would require fewer code bytes.
 
My algorithm may be larger, but it only takes two branches to get
through it, plus some minor overhead in each nibble, and I'm sure
some of that could be optimized with some thought.
 
Thank you,
Rick C. Hodgin
scott@slp53.sl.home (Scott Lurndal): Aug 01 05:35PM

>> time efficient that your algorithm.
 
>I took a look at those algorithms. Which one(s) would you suggest for
>use on the bit-scan forward and reverse algorithms?
 
benchmark them.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Aug 01 01:43PM -0400

On 8/1/2017 1:35 PM, Scott Lurndal wrote:
 
>> I took a look at those algorithms. Which one(s) would you suggest for
>> use on the bit-scan forward and reverse algorithms?
 
> benchmark them.
 
I will. It's a low priority item. You're free to go ahead and
benchmark them in the time between if you'd like, and I'll be happy
to read your results.
 
Thank you,
Rick C. Hodgin
David Brown <david.brown@hesbynett.no>: Aug 01 07:59PM +0200

On 01/08/17 19:05, Rick C. Hodgin wrote:
>> time efficient that your algorithm.
 
> I took a look at those algorithms. Which one(s) would you suggest for
> use on the bit-scan forward and reverse algorithms?
 
None of them.
 
As Scott pointed out, all the platforms that interest you have hardware
instructions for the job. If you are using existing compilers, use
their intrinsics. If you are writing your own compiler, implement
intrinsics, functions, operators, etc., using these instructions.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Aug 01 02:21PM -0400

On 8/1/2017 1:43 PM, Rick C. Hodgin wrote:
 
> I will. It's a low priority item. You're free to go ahead and
> benchmark them in the time between if you'd like, and I'll be happy
> to read your results.
 
It occurred to me. That algorithm you suggested does not do the
same thing my algorithm does. Mine scans down from msb to lsb and
reports the position of the largest bit set in the value.
 
The algorithm you posted scans up counting zeros.
 
Do you have one which scans down and reports the position of the
most significant bit set in the value?
 
Thank you,
Rick C. Hodgin
scott@slp53.sl.home (Scott Lurndal): Aug 01 06:34PM


>The algorithm you posted scans up counting zeros.
 
>Do you have one which scans down and reports the position of the
>most significant bit set in the value?
 
If you have the count of leading zeros, determining the bit position
of the MSb is a simple subtract.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Aug 01 02:38PM -0400

On 8/1/2017 2:34 PM, Scott Lurndal wrote:
>> most significant bit set in the value?
 
> If you have the count of leading zeros, determining the bit position
> of the MSb is a simple subtract.
 
I don't see any algorithms on that page which will count leading zeros:
 
http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightLinear
 
Only trailing zeros.
 
Thank you,
Rick C. Hodgin
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Aug 01 02:47PM -0400

On 8/1/2017 2:38 PM, Rick C. Hodgin wrote:
 
> I don't see any algorithms on that page which will count leading zeros:
 
> http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightLinear
 
> Only trailing zeros.
 
I did a benchmark on my algorithm and BSR on a byte value using rand()
with a srand(0) seed. The BSR assembly opcode version gave 1.879 on
100M iterations, and my algorithm gave 2.927.
 
BSR = 53.2M function calls per second
Mine = 34.2M function calls per second
 
Thank you,
Rick C. Hodgin
"Öö Tiib" <ootiib@hot.ee>: Aug 01 10:09AM -0700

On Tuesday, 1 August 2017 18:52:20 UTC+3, Rick C. Hodgin wrote:
> young interest, but at what age was his conversion? He didn't talk
> in depth to a Christian until his late 20s, so by that time he was
> already a scientist.
 
What? Of course whatever "truths" can hold that way when moving
definitions between scientist and student. Dr. Hugh Ross has said
that he "turned his whole self to God" even before he went to study
to University of British Columbia (where he got bachelor degree).
See here
https://www.cru.org/how-to-know-god/my-story-a-life-changed/hugh-ross.html
Was it "late 20s"?
 
My guidance to you is to not wiggle there and to not dig it deeper.
You have already left bad impression. Accept that you were
mistaken and so then there will be at least chance that it looks
like not deliberate lie but may be some misremembering or
misinterpretation of facts.
 
I do not want to prove you wrong. Everybody are fully convinced
already that you were wrong. I am just trying to explain it to you (and
at same time feeling that you are simply trolling me there).
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Aug 01 06:15PM +0100

On 01/08/2017 16:51, Rick C. Hodgin wrote:
>> converted happened in age 17 - 19. Was he then scientist when he
>> was age 17 - 19? Or was he student? What he was?
 
> I'll have to watch the video again. As I recall, he stated that he
 
In my original reply to your post you decided to ignore what I said in
favour of more preaching so again for avoidance of doubt:
 
In the video he said "from age 16 onwards I never doubted the existence
of God"
 
So from age 16 onwards he was NO LONGER AN ATHEIST. He was not an
atheist scientist at all.
 
I don't believe you made a mistake, I believe you are simply a bare
faced liar (not uncommon among Christians on the back foot).
 
/Flibble
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Aug 01 01:41PM -0400

On 8/1/2017 1:09 PM, Öö Tiib wrote:
> mistaken and so then there will be at least chance that it looks
> like not deliberate lie but may be some misremembering or
> misinterpretation of facts.
 
Well, FWIW, the title of the video is what I posted:
 
"Atheist Scientist Becomes Christian After Researching Evidence
for God"
 
https://www.youtube.com/watch?v=dsbj7EN1Uzs
 
I'm sorry you conclude that I'm lying by posting this video.
 
> I do not want to prove you wrong. Everybody are fully convinced
> already that you were wrong. I am just trying to explain it to you (and
> at same time feeling that you are simply trolling me there).
 
There's nothing I can say to teach you that you need Jesus to forgive
your sin, Öö Tiib. From this day forward I will relegate myself to
prayer for you and not reply to your posts. I know you already do
not believe in Jesus or that you need to be forgiven for your sin,
and it's not my job to convince you. I am simply putting the truth
before you. It is the job of God Himself to convince you. Not me.
 
I wish you well in your life, Öö Tiib. FWIW, I enjoy your posts.
 
Thank you,
Rick C. Hodgin
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: