Saturday, September 28, 2019

Digest for comp.lang.c++@googlegroups.com - 25 updates in 6 topics

aminer68@gmail.com: Sep 28 04:15PM -0700

Hello..
 
 
I think Delphi is a single pass compiler, it is very fast at compile time, and i think C++ and Java and C# are multi pass compilers that are much slower than Delphi in compile time, but i think that the generated executable code of Delphi is still fast and is faster than C#.
 
And what about the Advantages and disadvantages of single and multi pass compiler?
 
And From Automata Theory we get that any Turing Machine that does 2 (or more ) pass over the tape, can be replaced with an equivalent one that makes only 1 pass, with a more complicated state machine. At the theoretical level, they the same. At a practical level, all modern compilers make only one pass over the source code. It typically translated into an internal representation that the different phases analyze and update. During flow analysis basic blocks are identified. Common sub expression are found and precomputed and results reused. During loop analysis, invariant code will be moved out the loop. During code emission registers are assigned and peephole analysis and code reduction is applied.
 
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Sep 28 04:15PM -0700

Hello..
 
 
I think Delphi is a single pass compiler, it is very fast at compile time, and i think C++ and Java and C# are multi pass compilers that are much slower than Delphi in compile time, but i think that the generated executable code of Delphi is still fast and is faster than C#.
 
And what about the Advantages and disadvantages of single and multi pass compiler?
 
And From Automata Theory we get that any Turing Machine that does 2 (or more ) pass over the tape, can be replaced with an equivalent one that makes only 1 pass, with a more complicated state machine. At the theoretical level, they the same. At a practical level, all modern compilers make only one pass over the source code. It typically translated into an internal representation that the different phases analyze and update. During flow analysis basic blocks are identified. Common sub expression are found and precomputed and results reused. During loop analysis, invariant code will be moved out the loop. During code emission registers are assigned and peephole analysis and code reduction is applied.
 
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Sep 28 03:17PM -0700

Hello,
 
 
It is always interesting to read the following webpage:
 
Why C# coders should shut up about Delphi
 
https://jonlennartaasenden.wordpress.com/2016/10/18/why-c-coders-should-shut-up-about-delphi/
 
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Sep 28 02:43PM -0700

Hello,
 
 
As you have noticed that i was writing here about the buffer overflow problem..
 
Please read the following to understand more about it:
 
What is buffer overflow, an old vulnerability that's causing new problems?
 
Read more here:
 
https://www.dailydot.com/layer8/buffer-overflow-whatsapp/
 
 
Thank you,
Amine Moulay Ramdane.
red floyd <dont.bother@its.invalid>: Sep 27 02:38PM -0700

On 9/27/2019 12:43 PM, Ian Collins wrote:
> On 28/09/2019 04:54, rick.c.hodgin@gmail.com wrote:
>> [his usual drivel]
> You really a nasty bigoted twat.
 
And this surprises you how?
Christian Gollwitzer <auriocus@gmx.de>: Sep 28 08:25AM +0200

Am 27.09.19 um 19:30 schrieb David Brown:
> might provoke another ridiculous sermon.  But it bothers me too much to
> see prejudice left uncommented.
 
> The man introducing the speaker has long hair.  That is /all/.
 
I think he was referring to that video:
 
https://youtu.be/u_ij0YNkFUs?t=30
 
The teenage boy here wears a dress.
 
> Please stop being so judgemental and trying to find something to hate in
> everything and everyone.
 
Fully agreed. And even if one believes that God created man and woman,
there is not the slightest indication that he created dresses
exclusively for women. Dresses were created by humans, and Gods most
probably as well.
 
Christian
David Brown <david.brown@hesbynett.no>: Sep 28 10:35AM +0200

On 28/09/2019 08:25, Christian Gollwitzer wrote:
 
>> The man introducing the speaker has long hair.  That is /all/.
 
> I think he was referring to that video:
 
> https://youtu.be/u_ij0YNkFUs?t=30
 
That wasn't the video linked.
 
 
> The teenage boy here wears a dress.
 
Yes. So what? People can wear what they want, dress as they like,
within the standards considered acceptable to the people around in the
context in question. His clothes are entirely respectable - merely a
little unusual.
 
And if Rick thinks that is "drag" - well, I think he should probably get
out a bit more. Perhaps he should go and see a real drag show, or maybe
even /talk/ with some people who don't share his bigotry and fanaticism.
Perhaps he would learn that they are normal, friendly people just like
most others.
 
> there is not the slightest indication that he created dresses
> exclusively for women. Dresses were created by humans, and Gods most
> probably as well.
 
If you believe that a god created people as either male or female,
falling in strict categories for biology, appearance, sexuality,
behaviour - you have your eyes closed to reality. And if you believe
that a god is ordering you to hate and mistreat people who don't match
your blinkered black-or-white viewpoint, you have misunderstood the
message from that god.
 
(If you want to believe in a god that created the wide variety of people
we see around us, and that we should be as good people as we can towards
them all, then that's great.)
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Sep 28 01:51AM -0700

On 9/28/2019 1:35 AM, David Brown wrote:
 
> That wasn't the video linked.
 
>> The teenage boy here wears a dress.
 
> Yes.  So what?  People can wear what they want, dress as they like,
 
Hey man, that kilt looks like some sort of dress... Now we must attach
the scarlet letter. It reminds me of deductive reasoning:
 
https://youtu.be/H9PY_3E3h2c
 
This part:
 
https://youtu.be/H9PY_3E3h2c?t=202
 
[...]
Christian Gollwitzer <auriocus@gmx.de>: Sep 28 01:33PM +0200

Am 28.09.19 um 10:35 schrieb David Brown:
 
>> I think he was referring to that video:
 
>> https://youtu.be/u_ij0YNkFUs?t=30
 
> That wasn't the video linked.
 
Correct, but he referred to "the keynote with Bjarne Stroustrup" (see
above) which was probably suggested by Youtube to him from the linked
one. I merely tried to supplement the missing citation.
 
Christian
rick.c.hodgin@gmail.com: Sep 28 04:55AM -0700

Many people will consider this post "the usual drivel." And
whereas it is along the lines of what I would post regarding
our (man's) need for salvation through Jesus Christ, it is
not "drivel." There is ONE VOICE teaching you that it is
drivel, and that voice comes from the enemy of God, who is
actively at work in this world deceiving everyone, and all
who will not seek the truth will be deceived.
 
I advise you to go on a fact-finding mission to PROVE TO
YOURSELF if what I teach you is accurate or not. Go to the
Bible with a TRUTH-SEEKING heart and a strong desire to
learn if there really is this division in man, between the
saved and the unsaved, and if you really are on either one
side or the other.
 
Seek like if you knew there was gold in a field and you
were digging to find it. Uncover the things the enemy has
perverted in your knowledge in this world. Have the goal
in your heart of NOT BEING DECEIVED, so that you will come
to the truth ... because that truth WILL make you FREE.
 
Consider: I'm not asking you for money. I'm not asking
you to join MY cause. I'm asking you to seek THE TRUTH.
I'm asking you to investigate FOR YOURSELF with that full
truth-seeking heart.
 
When you do, you will find what I'm talking about, and not
because I say so, but because it's all real.
 
God really does exist. He really does have a purpose for
your life. He really is revealed in scripture, which all
points to His Son Jesus Christ, who really did come into
the world to take our sin away so we could be saved from
that judgment for sin, the righteous One entering in to
the corruption of this world to become that corruption in
our place, thereby taking it away from us, and setting us
free from it.
 
Look around you and see the corruption everywhere. Even
in your own body as you get cancer, or you need glasses,
or any other host of things.
 
God's Kingdom is not like that. SIN has brought about
this vile wicked world. And God came here to save us
from it.
 
Put your full faith and trust in Jesus Christ. Lean into
Him with all your weight. He is stable and is able to
bear it all without shaking, without flinching, without a
second thought of negativity toward you regarding for all
that you place upon His shoulders. It is His great pleasure
to set us free from sin, and bear our burdens, so that we
can be set free in this world from the weight of those bur-
dens, so that we can see the down payment of what He's given
us eternity, even while we yet remain in this world for a
time.
 
Read on and seek the full truth in these words:
 
===>
 
On 9/28/2019 4:51 AM, Chris M. Thomasson wrote:
> Hey man, that kilt looks like some sort of dress... Now we must attach
> the scarlet letter. It reminds me of deductive reasoning:
 
> [...]
 
The Bible teaches that a man is not to wear a woman's clothing:
 
https://www.biblegateway.com/passage/?search=Deuteronomy+22%3A5&version=NIV;KJV
 
Now that is under the Law of Moses, which we are NOT under when
under the Grace of Jesus Christ, but it provides us with infor-
mation on the character and intent of God regarding us. And just
as many things in the Old Testament and Old Covenant are still
called for Christians to do in the New Covenant, each of them
conveys the intent of God regarding our lives.
 
IIRC, the cross-dressing male in that video was introduced and
identified himself as "Rachel."
 
It was only a few years ago in this country (USA) that such a
position would've been deemed a medical condition. It still is
actually in several circles, as not everyone buys into the new
political agenda of self-gendering as both being normal and a
right. It is not.
 
God made them male and female for a reason. It is a preface, a
preview, an example we can relate to, of what we will be (the
bride of Christ) to Jesus (our Bridegroom) in eternity, for the
Bible teaches there will be a marriage, and just as marriages
are here on Earth where all the woman has becomes the man's,
and all the man has becomes the woman's, and the two are joined
together to be one ... so it will be with us and God.
 
This is the promise Jesus gives us in the New Testament, in the
Bible in general, and it is the enemy of God, literally Satan
himself and his demon army, who are teaching otherwise.
 
Satan is a defeated foe. Anyone following after Satan's guid-
ance will share in that defeat on the Day of Judgment. What
Jesus offers us is salvation from that judgment, and the full
and complete redemption and restoration of our souls to the
rightful place in Heaven God created us to occupy.
 
God's goals for us are glorious beyond words. Remember that
when you look out into the blue sky and the green trees and
the sandy beaches, and remember that He made ALL of this as a
mere LIFE SUPPORT SYSTEM for us. None of that STUFF matters.
 
What matters is YOU. And God is calling you to be a part of
His eternal Kingdom, restored to our true nature, which is not
just this physical flesh, but involves the spirit.
 
For those of you who have no idea what the spirit is, it's us
in another form. If you've ever seen the TV show Andromeda,
where Romy is in physical form, but she's also a hologram,
and she's also the ship, that's kind of like it wish us. We
are our soul (the ship), we are our spirit (the hologram), and
we are our body (the android).
 
On Star Wars, some members of council were there in physical
form. Some came through via holograms. That's like our phys-
ical and spiritual selves.
 
It's not the same, but it's something unsaved people can wrap
their thoughts around to kind of convey what it's like. You
can read about what Jesus teaches about the flesh and spirit
in John 3:
 
https://www.biblegateway.com/passage/?search=John+3&version=NIV;KJV
 
Heaven will not be like the Earth. God didn't create a place
for us to be where there's pain, suffering, agony, hate, etc.
Sin has brought all of that about, and the enemy of God has
done his level best to convince us this is all God's doing,
when it's really his doing.
 
If you read the Bible on a "fact-finding mission" with a
"truth-seeking heart," then you will uncover the TRUE nature
of the things God has in store for us, and not the lies of
the enemy taught to each of us by our society, our media,
hand-me-down tales, etc.
 
If you think God is anything less than being EXACTLY what
you, your family, your co-workers, your friends, your neigh-
bors, everyone needs, then you do not yet understand properly.
 
If there was one thing that was the best thing for you, it is
literally Jesus. He's better for you than a loving spouse.
He's better for you than a high paying job that explores your
full range of abilities and interests with grandeur. He's
more important to you than food, or water, or even air, for
in Him (in Jesus) is the ONE WAY God has provided to restore
you from sin, to save you from judgment, to give you a path
back to His Kingdom in eternity, for we are all ALREADY on
the path to Hell, even if we don't realize it yet, and it is
exactly because of sin and the cancerous deception that sin
brings, which is so pervasive it COMPLETELY DESTROYS every-
thing it touches, which is why God has isolated it into a
sole place in His creation, the place called Hell. Nothing
entering into Hell will EVER come out. It is a hard barrier
between the full-on goodness and truth of His creation, and
the full-on badness and falseness of those who embrace sin.
 
Stop listening to the enemy's voice about who God is. Pick
up a Bible and begin reading. Give yourself license to go
on that fact-finding mission, to seek out the truth with
real earnest zeal. Do not relent until you demand of what
God has provided for us the FULL TRUTH to answer every one
of your questions. I promise you, you will find everything
you seek written within, and not all of it will come from
words on the page, but through the spirit I mentioned above,
a pledge of earnest for our full inheritance. We will re-
ceive now, in this world, that earnest, a deposit, a type
of guarantee of what we will receive once we shed our mor-
tality, shed our corruption, and put on immortality and
incorruption.
 
God is real. He's loving. He's provisioning. He's given
us more than we realize, including the opportunity to COME
BACK to Him despite our guilt in sin. He doesn't want to
judge us. He wants to forgive us. But it will be one or
the other for every human soul.
 
-----
Be one who is saved. Do not be one who is judged. Humble
yourself before God. Acknowledge your sin, your guilt,
and ask Jesus to save you. He will, because it is His great
pleasure to receive a soul back into His Kingdom when they
come to repentance. It would be like you receiving your son
or daughter back after they stopped doing the criminal or
self-destructive thing they've been doing. To have that pre-
viously lost soul back in your life ... oh the joy! And it
is God's great pleasure to extend to us that reception back
into His Kingdom, so that His joy may abound, as well as
ours.
 
Consider your future. Everybody dies, but not everybody
needs to fear death. Death is the gateway between our cor-
ruption and mortality here, and the incorruption and im-
mortality there. You can read about this in Paul's writ-
ings in Ephesians and 1 Corinthians:
 
https://www.biblegateway.com/passage/?search=Ephesians+1%3A13-14%2C+1+Corinthians+15%3A53-55&version=NIV;KJV
 
There is so much information in the Bible. It's spread out
in importance, some given here, some given there, so that
the one who looks deeply into it will see it, but the one
who casually glances only at the surface will never see it.
 
Seek after the TRUE KNOWLEDGE of God with a discerning
heart and a focused will. Do it on purpose to learn the
truth and you will find it. That's a promise from God.
And I bear witness of that promise.
 
--
Rick C. Hodgin
rick.c.hodgin@gmail.com: Sep 28 05:05AM -0700

On Saturday, September 28, 2019 at 2:25:47 AM UTC-4, Christian Gollwitzer wrote:
> there is not the slightest indication that he created dresses
> exclusively for women. Dresses were created by humans, and Gods most
> probably as well.
 
On the day of judgment, ignorance will not be a valid excuse,
because all of the information God has given us about His
guidance for us, and the nature of this world in sin, and
the nature of our redemption through Christ, has been given
to us.
 
In America, you can't pass through a city and not find more
than several churches. They are within walking distance
from probably 80-90% of the U.S. population, and within
driving distance of the rest. It's on TV. Bibles can be
ordered on Amazon.com and shipped right to your door. You
can invite your Christian neighbor over for dinner, or that
co-worker, etc.
 
There will be no excuses:
 
https://www.biblegateway.com/passage/?search=Deuteronomy+22%3A5&version=NIV;KJV
 
KJV -- "5 The woman shall not wear that which pertaineth
unto a man, neither shall a man put on a woman's garment:
for all that do so are abomination unto the Lord thy God."
 
NIV -- "5 A woman must not wear men's clothing, nor a man
wear women's clothing, for the Lord your God detests anyone
who does this."
 
Note: See my reply to Chris Thomasson for extended info
on this Old Testament Law:
 
https://groups.google.com/d/msg/comp.lang.c++/t899RBBgr5A/543XNA0GCgAJ
 
The enemy of God has deceived the entire world with his lies.
Everyone who will not pursue the truth actively will be de-
ceived by that enemy, leading to their soul's death on Judgment
Day, and their soul being cast into Hell for all eternity.
 
But for all who will seek the truth they will be saved.
 
Many will be shocked to learn after they leave this world that
it was true, that sin was real, that judgment was real, that
Hell is real, that the warnings men and women like me have
given you throughout your ENTIRE LIFE were real. It will be
too late then to be saved. It is not too late today.
 
https://www.biblegateway.com/passage/?search=Hebrews+3%3A13-15&version=NIV;KJV
 
Do not harden your heart.
While it is called "today" seek Him.
 
To you, "Christian G," and the others who will read this, in-
cluding David Brown, Leigh Johnston, Scott Lurndal, among others.
 
Seek the truth. Don't let it fall down on you on Judgment Day.
Find it today while you can STILL be saved.
 
--
Rick C. Hodgin
Christian Gollwitzer <auriocus@gmx.de>: Sep 28 03:52PM +0200


> NIV -- "5 A woman must not wear men's clothing, nor a man
> wear women's clothing, for the Lord your God detests anyone
> who does this."
 
And where in the bible is the definition, what constitutes a "woman's
garment" and what "men's clothing"? This has varied over the ages and
cultures so much that this statement is simply incomplete. Which is no
wonder because it was written and edited by humans.
 
 
Christian
rick.c.hodgin@gmail.com: Sep 28 07:34AM -0700

On Saturday, September 28, 2019 at 9:52:55 AM UTC-4, Christian Gollwitzer wrote:
 
> And where in the bible is the definition, what constitutes a "woman's
> garment" and what "men's clothing"? This has varied over the ages and
> cultures so much that this statement is simply incomplete.
 
If you don't know, look to history, what has been traditional in your
area, from your grandparents, parents, society at large.
 
God recognizes variances in societal norms. The main teaching here is
that men are to be men, and women women, and the two are not to have
any crossover.
 
This is reinforced by teachings against homosexuality, and even from
men being effeminate.
 
https://www.biblegateway.com/passage/?search=1+Corinthians+6%3A9-10&version=NASB;KJV
 
It's written by men, inspired by God's Holy Spirit, which was like a
narrator inside your thoughts instructing them what to write. The
whole of scripture affirms itself despite being written by about 40
different people over 1500 years.
 
--
Rick C. Hodgin
Bo Persson <bo@bo-persson.se>: Sep 28 04:47PM +0200


> God recognizes variances in societal norms. The main teaching here is
> that men are to be men, and women women, and the two are not to have
> any crossover.
 
Seem to me that in many popular images, Jesus himself was wearing
something that looks like a dress.
 
Like here:
 
https://www.jw.org/en/bible-teachings/questions/was-jesus-married/
rick.c.hodgin@gmail.com: Sep 28 08:39AM -0700

On Saturday, September 28, 2019 at 10:47:18 AM UTC-4, Bo Persson wrote:
> something that looks like a dress.
 
> Like here:
 
> https://www.jw.org/en/bible-teachings/questions/was-jesus-married/
 
The Bible describes priestly attire for the tribe of Levi:
 
https://www.bible-history.com/tabernacle/TAB4The_Priestly_Garments.htm
 
It's probably why he's portrayed like that. Also Jerusalem was
under Roman rule during that time. Togas, etc.
 
Regardless, the teaching is based on societal norms, and not
specific garments. In addition, Christians are not under the Law
any longer, but the call remains to be separately men as men in
men's attire, women as women in women's attire, to be separate
and distinct.
 
You make the teaching intentionally difficult, and unnecessarily
so. It reflects one thing: The state of your heart in sin.
 
--
Rick C. Hodgin
Manfred <noname@invalid.add>: Sep 28 06:49PM +0200

On 9/28/19 10:35 AM, David Brown wrote:
> within the standards considered acceptable to the people around in the
> context in question.  His clothes are entirely respectable - merely a
> little unusual.
 
I'll have a bit of an out-of-the-choir voice here.
 
My question is why the boy was invited on stage.
I am open to correction, but it is possible that the boy's outfit was
the reason Jon Kalb invited him on the stage - possibly to promote a
message about minorities' inclusion (or anything else, my only point is
that whatever the reason it doesn't seem related to software development).
 
From this perspective, irrespective of the moderator's intentions, it
can be seen as an off-topic sketch in a software conference. In other
words, if Rick gets criticism (rightly) when he uses the audience of
this newsgroup to spread his message about the bible, maybe the action
of using an audience gathered to listen to Bjarne for a different
purpose can be seen as a stretch as well.
 
[snipping even further digression]
Manfred <noname@add.invalid>: Sep 28 07:50PM +0200

On 9/28/2019 6:49 PM, Manfred wrote:
 
> I'll have a bit of an out-of-the-choir voice here.
 
> My question is why the boy was invited on stage.
> I am open to correction,
And I should be.
 
> the reason Jon Kalb invited him on the stage - possibly to promote a
> message about minorities' inclusion (or anything else, my only point is
> that whatever the reason it doesn't seem related to software development).
Listening closer to the fragment, I realized my message was wrong.
My apologies.
[snipped]
Keith Thompson <kst-u@mib.org>: Sep 28 12:37PM -0700

And yet again, a bigoted troll has succeeded in turning this newsgroup's
attention to the irrelevant issues he cares about.
 
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 28 10:08PM +0100

> God made them male and female for a reason.
And Satan invented fossils, yes?
 
Will the real, bigoted, misogynist, homophobic and fucktarded Rick C.
Hodgin please fuck off.
 
/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," Bryne 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."
Mark <ma740988@gmail.com>: Sep 27 07:37PM -0700

[code]
 
 
# ifndef XXX_YYY
# define XXX_YYY
 
//# pragma once //this is what you should do today and beyond (all things being equal .. compiler support)
# include <cstddef>
# include <iostream>
 
namespace foo
{
enum kFavoriteWine { kMoscato, XXX_YYY } ;
}
 
 
# endif
 
auto main() -> int
{
using namespace foo ;
kFavoriteWine xx = XXX_YYY ;
 
}
Why does the upper case enumerator collided with the preprocessor macro even though the macro is wrapped in a namespace? Can someone point me to some standard verbiage saying why that's wrong
 
[/code]
Ian Collins <ian-news@hotmail.com>: Sep 28 02:43PM +1200

On 28/09/2019 14:37, Mark wrote:
> }
 
> # endif
 
> auto main() -> int
 
Horrid style..
 
> Why does the upper case enumerator collided with the preprocessor
> macro even though the macro is wrapped in a namespace? Can someone
> point me to some standard verbiage saying why that's wrong
 
A macro is a simple text substitution performed by the preprocessor, so
your code is changed to something like
 
namespace foo
{
enum kFavoriteWine { kMoscato, } ;
}
 
auto main() -> int
{
using namespace foo ;
kFavoriteWine xx = ;
 
}
 
before it is compiled.
 
--
Ian.
Louis Krupp <lkrupp@nospam.pssw.com.invalid>: Sep 27 11:48PM -0600

On Fri, 27 Sep 2019 19:37:29 -0700 (PDT), Mark <ma740988@gmail.com>
wrote:
 
 
>}
>Why does the upper case enumerator collided with the preprocessor macro even though the macro is wrapped in a namespace? Can someone point me to some standard verbiage saying why that's wrong
 
>[/code]
 
To expand on Ian's post, it doesn't collide. I don't know if this is
in the standard, but if you're using the preprocessor that comes with
gcc and g++, "#define <macro>" with no text gets you an empty
definition:
 
https://stackoverflow.com/questions/13892191/are-empty-macro-definitions-allowed-in-c-how-do-they-behave
 
Louis
Bo Persson <bo@bo-persson.se>: Sep 28 10:06AM +0200

On 2019-09-28 at 04:37, Mark wrote:
 
> }
> Why does the upper case enumerator collided with the preprocessor macro even though the macro is wrapped in a namespace? Can someone point me to some standard verbiage saying why that's wrong
 
> [/code]
 
The preprocessor doesn't care about namespaces, it just replaces
everything, everywhere.
 
One common way to avoid this problem is to reserve all-uppercase
identifiers for the preprocessor, and not use those for anything else.
 
 
Bo Persson
Ben Bacarisse <ben.usenet@bsb.me.uk>: Sep 28 09:58PM +0100


> # define XXX_YYY
<cut>
> {
> enum kFavoriteWine { kMoscato, XXX_YYY } ;
> }
 
<cut>
 
> Why does the upper case enumerator collided with the preprocessor
> macro even though the macro is wrapped in a namespace? Can someone
> point me to some standard verbiage saying why that's wrong
 
To expand yet again on the other answers...
 
The verbiage is section 2.2 Phases of Translation. It explains the
logical sequence in which source files are processed. Macros are
expanded in phase 4, whereas what we usually think of a parsing happens
in phase 7. By phase 7 there is no identifier 'XXX_YYY' -- they all
vanished in phase 4.
 
--
Ben.
aminer68@gmail.com: Sep 28 01:55PM -0700

Hello,
 
 
About the buffer overflow problem..
 
I wrote yesterday about buffer overflow in Delphi and Freepascal..
 
I think there is a "higher" abstraction in Delphi and Freepascal
that does the job very well of avoiding buffer overflow, and it is
the TMemoryStream class, since it behaves also like a pointer
and it supports reallocmem() and freemem() on the pointer but
with a higher level abstraction, look for example at my
following example in Delphi and Freepascal, you will notice
that contrary to pointers , that the memory stream is adapting with writebuffer() without the need of reserving the memory, and this is why it avoids the buffer overflow problem, read the following example to notice how i am using it with a PAnsichar type:
 
========================================
 
 
Program test;
 
 
uses system.classes,system.sysutils;
 
 
var P: PAnsiChar;
 
 
Begin
 
 
P:='Amine';
 
 
mem:=TMemorystream.create;
 
mem.position:=0;
 
mem.writebuffer(pointer(p)^,6);
 
mem.position:=0;
 
writeln(PAnsichar(mem.memory));
 
 
 
end.
 
 
===================================
 
 
So since Delphi and Freepascal also detect the buffer overflow on dynamic arrays , so i think that Delphi and Freepascal are powerful
tools.
 
 
Read my previous thoughts below to understand more:
 
 
And I have just read the following webpage about "Fearless Security: Memory safety":
 
https://hacks.mozilla.org/2019/01/fearless-security-memory-safety/
 
Here is the memory safety problems:
 
1- Misusing Free (use-after-free, double free)
 
I have solved this in Delphi and Freepascal by inventing a "Scalable" reference counting with efficient support for weak references. Read below about it.
 
 
2- Uninitialized variables
 
This can be detected by the compilers of Delphi and Freepascal.
 
 
3- Dereferencing Null pointers
 
I have solved this in Delphi and Freepascal by inventing a "Scalable" reference counting with efficient support for weak references. Read below about it.
 
4- Buffer overflow and underflow
 
This has been solved in Delphi by using madExcept, read here about it:
 
http://help.madshi.net/DebugMm.htm
 
You can buy it from here:
 
http://www.madshi.net/
 
 
And about race conditions and deadlocks problems and more, read my following thoughts to understand:
 
 
I will reformulate more smartly what about race conditions detection in Rust, so read it carefully:
 
You can think of the borrow checker of Rust as a validator for a locking system: immutable references are shared read locks and mutable references are exclusive write locks. Under this mental model, accessing data via two independent write locks is not a safe thing to do, and modifying data via a write lock while there are readers alive is not safe either.
 
So as you are noticing that the "mutable" references in Rust follow the Read-Write Lock pattern, so this is not good, because it is not like more fine-grained parallelism that permits us to run the writes in "parallel" and gain more performance from parallelizing the writes.
 
 
Read more about Rust and Delphi and my inventions..
 
I think the spirit of Rust is like the spirit of ADA, they are especially designed for the very high standards of safety, like those of ADA, "but" i don't think we have to fear race conditions that Rust solve, because i think that race conditions are not so difficult to avoid when you are a decent knowledgeable programmer in parallel programming, so you have to understand what i mean, now we have to talk about the rest of the safety guaranties of Rust, there remain the problem of Deadlocks, and i think that Rust is not solving this problem, but i have provided you with an enhanced DelphiConcurrent library for Delphi and Freepascal that detects deadlocks, and there is also the Memory Safety guaranties of Rust, here they are:
 
1- No Null Pointer Dereferences
2- No Dangling Pointers
3- No Buffer Overruns
 
But notice that I have solved the number 1 and number 2 by inventing my
scalable reference counting with efficient support for weak references
for Delphi and Freepascal, read below to notice it, and for number 3 read my following thoughts to understand:
 
More about research and software development..
 
I have just looked at the following new video:
 
Why is coding so hard...
 
https://www.youtube.com/watch?v=TAAXwrgd1U8
 
 
I am understanding this video, but i have to explain my work:
 
I am not like this techlead in the video above, because i am also an "inventor" that has invented many scalable algorithms and there implementions, i am also inventing effective abstractions, i give you an example:
 
Read the following of the senior research scientist that is called Dave Dice:
 
Preemption tolerant MCS locks
 
https://blogs.oracle.com/dave/preemption-tolerant-mcs-locks
 
As you are noticing he is trying to invent a new lock that is preemption tolerant, but his lock lacks some important characteristics, this is why i have just invented a new Fast Mutex that is adaptative and that is much much better and i think mine is the "best", and i think you will not find it anywhere, my new Fast Mutex has the following characteristics:
 
1- Starvation-free
2- Good fairness
3- It keeps efficiently and very low the cache coherence traffic
4- Very good fast path performance (it has the same performance as the
scalable MCS lock when there is contention.)
5- And it has a decent preemption tolerance.
 
 
this is how i am an "inventor", and i have also invented other scalable algorithms such as a scalable reference counting with efficient support for weak references, and i have invented a fully scalable Threadpool, and i have also invented a Fully scalable FIFO queue, and i have also invented other scalable algorithms and there inmplementations, and i think i will sell some of them to Microsoft or to
Google or Embarcadero or such software companies.
 
 
Read my following writing to know me more:
 
More about computing and parallel computing..
 
The important guaranties of Memory Safety in Rust are:
 
1- No Null Pointer Dereferences
2- No Dangling Pointers
3- No Buffer Overruns
 
I think i have solved Null Pointer Dereferences and also solved Dangling Pointers and also solved memory leaks for Delphi and Freepascal by inventing my "scalable" reference counting with efficient support for weak references and i have implemented it in Delphi and Freepascal (Read about it below), and reference counting in Rust and C++ is "not" scalable.
 
About the (3) above that is Buffer Overruns, read here about Delphi and Freepascal:
 
What's a buffer overflow and how to avoid it in Delphi?
 
read my above thoughts about it.
 
 
About Deadlock and Race conditions in Delphi and Freepascal:
 
I have ported DelphiConcurrent to Freepascal, and i have
also extended them with the support of my scalable RWLocks for Windows and Linux and with the support of my scalable lock called MLock for Windows and Linux and i have also added the support for a Mutex for Windows and Linux, please look inside the DelphiConcurrent.pas and FreepascalConcurrent.pas files inside the zip file to understand more.
 
You can download DelphiConcurrent and FreepascalConcurrent for Delphi and Freepascal from:
 
https://sites.google.com/site/scalable68/delphiconcurrent-and-freepascalconcurrent
 
DelphiConcurrent and FreepascalConcurrent by Moualek Adlene is a new way to build Delphi applications which involve parallel executed code based on threads like application servers. DelphiConcurrent provides to the programmers the internal mechanisms to write safer multi-thread code while taking a special care of performance and genericity.
 
In concurrent applications a DEADLOCK may occurs when two threads or more try to lock two consecutive shared resources or more but in a different order. With DelphiConcurrent and FreepascalConcurrent, a DEADLOCK is detected and automatically skipped - before he occurs - and the programmer has an explicit exception describing the multi-thread problem instead of a blocking DEADLOCK which freeze the application with no output log (and perhaps also the linked clients sessions if we talk about an application server).
 
Amine Moulay Ramdane has extended them with the support of his scalable RWLocks for Windows and Linux and with the support of his scalable lock called MLock for Windows and Linux and he has also added the support for a Mutex for Windows and Linux, please look inside the DelphiConcurrent.pas and FreepascalConcurrent.pas files to
understand more.
 
And please read the html file inside to learn more how to use it.
 
 
About race conditions now:
 
My scalable Adder is here..
 
As you have noticed i have just posted previously my modified versions of DelphiConcurrent and FreepascalConcurrent to deal with deadlocks in parallel programs.
 
But i have just read the following about how to avoid race conditions in Parallel programming in most cases..
 
Here it is:
 
https://vitaliburkov.wordpress.com/2011/10/28/parallel-programming-with-delphi-part-ii-resolving-race-conditions/
 
This is why i have invented my following powerful scalable Adder to help you do the same as the above, please take a look at its source code to understand more, here it is:
 
https://sites.google.com/site/scalable68/scalable-adder-for-delphi-and-freepascal
 
Other than that, about composability of lock-based systems now:
 
Design your systems to be composable. Among the more galling claims of the detractors of lock-based systems is the notion that they are somehow uncomposable:
 
"Locks and condition variables do not support modular programming," reads one typically brazen claim, "building large programs by gluing together smaller programs[:] locks make this impossible."9 The claim, of course, is incorrect. For evidence one need only point at the composition of lock-based systems such as databases and operating systems into larger systems that remain entirely unaware of lower-level locking.
 
There are two ways to make lock-based systems completely composable, and each has its own place. First (and most obviously), one can make locking entirely internal to the subsystem. For example, in concurrent operating systems, control never returns to user level with in-kernel locks held; the locks used to implement the system itself are entirely behind the system call interface that constitutes the interface to the system. More generally, this model can work whenever a crisp interface exists between software components: as long as control flow is never returned to the caller with locks held, the subsystem will remain composable.
 
Second (and perhaps counterintuitively), one can achieve concurrency and
composability by having no locks whatsoever. In this case, there must be
no global subsystem state—subsystem state must be captured in per-instance state, and it must be up to consumers of the subsystem to assure that they do not access their instance in parallel. By leaving locking up to the client of the subsystem, the subsystem itself can be used concurrently by different subsystems and in different contexts. A concrete example of this is the AVL tree implementation used extensively in the Solaris kernel. As with any balanced binary tree, the implementation is sufficiently complex to merit componentization, but by not having any global state, the implementation may be used concurrently by disjoint subsystems—the only constraint is that manipulation of a single AVL tree instance must be serialized.
 
Read more here:
 
https://queue.acm.org/detail.cfm?id=1454462
 
And about Message Passing Process Communication Model and Shared Memory Process Communication Model:
 
An advantage of shared memory model is that memory communication is faster as compared to the message passing model on the same machine.
 
Read the following to notice it:
 
Why did Windows NT move away from the microkernel?
 
"The main reason that Windows NT became a hybrid kernel is speed. A microkernel-based system puts only the bare minimum system components in the kernel and runs the rest of them as user mode processes, known as servers. A form of inter-process communication (IPC), usually message passing, is used for communication between servers and the kernel.
 
Microkernel-based systems are more stable than others; if a server crashes, it can be restarted without affecting the entire system, which couldn't be done if every system component was part of the kernel. However, because of the overhead incurred by IPC and context-switching, microkernels are slower than traditional kernels. Due to the performance costs of a microkernel, Microsoft decided to keep the structure of a microkernel, but run the system components in kernel space. Starting in Windows Vista, some drivers are also run in user mode."
 
 
More about message passing..
 
An advantage of shared memory model is that memory communication is faster as compared to the message passing model on the same machine.
 
Read the following to notice it:
 
"One problem that plagues microkernel implementations is relatively poor performance. The message-passing layer that connects
different operating system components introduces an extra layer of
machine instructions. The machine instruction overhead introduced
by the message-passing subsystem manifests itself as additional
execution time. In a monolithic system, if a kernel component needs
to talk to another component, it can make direct function calls
instead of going through a third party."
 
However, shared memory model may create problems such as synchronization and memory protection that need to be addressed.
 
Message passing's major flaw is the inversion of control–it is a moral equivalent of gotos in un-structured programming (it's about time somebody said that message passing is considered harmful).
 
Also some research shows that the total effort to write an MPI application is significantly higher than that required to write a shared-memory version of it.
 
And more about my scalable reference counting with efficient support for weak references:
 
My invention that is my scalable reference counting with efficient support for weak references version 1.37 is here..
 
Here i am again, i have just updated my scalable reference counting with
efficient support for weak references to version 1.37, I have just added a TAMInterfacedPersistent that is a scalable reference counted version,
and now i think i have just made it complete and powerful.
 
Because I have just read the following web page:
 
https://www.codeproject.com/Articles/1252175/Fixing-Delphis-Interface-Limitations
 
But i don't agree with the writting of the guy of the above web page, because i think you have to understand the "spirit" of Delphi, here is why:
 
A component is supposed to be owned and destroyed by something else, "typically" a form (and "typically" means in english: in "most" cases, and this is the most important thing to understand). In that scenario, reference count is not used.
 
If you pass a component as an interface reference, it would be very unfortunate if it was destroyed when the method returns.
 
Therefore, reference counting in TComponent has been removed.
 
Also because i have just added TAMInterfacedPersistent to my invention.
 
To use scalable reference counting with Delphi and FreePascal, just replace TInterfacedObject with my TAMInterfacedObject that is the scalable reference counted version, and just replace TInterfacedPersistent with my TAMInterfacedPersistent that is the scalable reference counted version, and you will find both my TAMInterfacedObject and my TAMInterfacedPersistent
inside the AMInterfacedObject.pas file, and to know how to use weak references please take a look at the demo that i have included called example.dpr and look inside my zip file at the tutorial about weak references, and to know how to use
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: