Wednesday, September 19, 2018

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

Robert Wessel <robertwessel2@yahoo.com>: Sep 19 12:10PM -0500

On Wed, 19 Sep 2018 13:43:56 +0200, David Brown
>limits on your type sizes. There is no "as it should be for a
>language". There is just a matter of picking the rules that give the
>smallest risk of problems for developers in the language.
 
 
Actually there is a solution, although it's clearly not one that could
work in the context of C or C++ (well, you can do some of this with
C++, but not for the basic types).
 
There are clearly needs for different classes of arithmetic. You have
proper arithmetic (one's that actually perform more or less as you'd
expect numbers to behave from the rules of arithmetic - more or less
these need to generate larger intermediate results as necessary to
complete the computation *correctly* - perhaps you'd prefer the term
rational) types, integer types with various ranges and overflow
characteristics (signed unsigned, wrapping, saturating, trapping),
floating and complex types (possibly in a couple of formats), and if
you really want, I'll concede quaternions. We can come up with a few
more as well - for example we might have scaled arithmetic types.
 
So there need to be a few ground rules. A hard rule is that there
should be no implicit value losing conversions. This would, for
example allow an implicit conversion from a uint8 to an int16, as well
as all the normal widenings. C's poorly defined sizes make applying
that rule problematic in any event.
 
I prefer a somewhat stronger rule that in general there are no
conversions between classes of numbers, with a few possible
exceptions. Thus you can't add a uint8 and an int16 without
explicitly specifying a conversion for one of them, but you can add an
int8 and an int16 (with the former being promoted implicitly).
 
An even stronger rule is possible, not allowing any implicit
conversions, even simple widenings, but that seems too strict to me.
 
Obviously different classes of numbers will allow different operations
(for example, floating and arithmetic types don't allow boolean
operations).
 
A crucial point is that assignment is also limited, and most narrowing
assignments are not allowed without an explicit conversion. Some
might be allowed (for example, a sat16 result has an obvious
conversion to a sat8, arithmetic types narrow naturally, but would
require overflow handling). Of course there are no implicit
conversions between classes at assignment either.
 
Also required is a way of handling overflows and exceptions, and those
can be considered part of the explicit conversions. In many cases it
might only be the specification of how to handle the overflow (you
might generically specify that a saturated or wrapping number gets
narrowed in the normal way).
 
I'm not a stickler for absolute purity, there may be well defined, and
useful, exceptions to the "no implicit conversion" rule. For example,
converting a floating type to a complex (at least with a cartesian
complex) is risk free and actually fairly common. On the other hand,
I'm not willing to add a great deal of complexity to support that.
 
And since the subject of literals has come up, you can deal with those
too, without having to explicitly type all of them - any literal has a
partial type that doesn't get fully established until it's combined
with something. Thus a "-300" could turn into a sat16, int16 or the
like, as well as a float, but could not turn into an unsigned type, or
any 8-bit type. "3.4" could become a floating or complex type, but
not any integer type (if we allowed scaled arithmetic types, it might
become one of those as well).
 
As a general comment, *most* math should get done with
arithmetic/rational or floating types, and the integer types would
serve more specialized purposes.
 
Well, my rant for the day...
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 19 08:24PM +0100

On 19/09/2018 15:49, Rick C. Hodgin wrote:
 
> In any event, CAlive will reverse that decision made by the C
> committee some 30+ years ago.  Dare I to be so bold?  Why yes,
> yes I do dare.
 
Nobody cares. Your CAlive programming language is as batshit crazy as you
are. Maybe you should suggest it to the TempleOS guy as he is as batshit
crazy (and bigoted) as you.
 
/Flibble
 
--
"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."
David Brown <david.brown@hesbynett.no>: Sep 19 10:46PM +0200

On 19/09/18 15:33, Rick C. Hodgin wrote:
> capabilities likely mis-translated by what I intended to mean
> in what I wrote, and what you believed it to mean when you read
> it back.
 
You are correct that I don't have CAlive in front of me - I base my
responses to your posts entirely on your posts. If I get the wrong
impression of it sometimes, there is only one person who could help that.
 
I have experience with a /lot/ of programming languages. I estimate I
have had some use of nearly two dozen over the years - though I would
not claim to know many of them very well. I have used a few of these
that /required/ a gui of some sort for development. And without
exception, the more the gui was required, the less practical the
language for real, serious work. There is no substitute from being able
to read and write the code in normal letters using a normal keyboard and
a normal editor.
 
Now, a good gui and IDE makes the job much easier - C development is
greatly aided by an editor with syntax highlighting, code completion,
navigation between identifiers and their definitions or declarations,
and so on. There is no doubt that I am much more productive working
with Eclipse than with Notepad.
 
But my experience is that to be useful as a good programming language,
it should be possible to work with code as text. It should be possible
to take a function in the language, and post it as text in a newsgroup
post - and have people understand it. It should not need different
coloured bits to be comprehensible. It should not need you to click on
different bits to see what it does, or hold your mouse over it to expand
sections to see how they work. It should not need to be translated to
C, assembly, or anything else to make its meaning clear.
 
This is, of course, merely my opinion.
 
 
> I understood your point.  I think your viewpoint is wrong,
> because I think compiler switches exist for a reason and
> they are to be employed properly.
 
No, you have misunderstood it. I /agree/ that compiler switches can be
used usefully.
 
But they can also be /abused/. If code is dependent on compiler
switches for correctness, and the switches affect how the same source
text behaves, then that is a bad thing. Code functionality should - as
much as possible - be determined by the code written, not by things
outside it.
 
From what you wrote about the way you handle choices about overflows,
using casks, it sounds like you /agree/ with me here. That's why I say
you misunderstand my point.
 
> large and concluding there are wrong aspects of its design be-
> cause you haven't yet seen the whole thing and can't envision
> it.
 
The peephole I use is the one you give me. You know fine I will not be
clicking on any video links, nor will I be downloading CAlive. You make
posts here, I respond to them. If there are things about CAlive that
are relevant and that I am missing, you need to tell me. I comment on
the /language/ - the text you show here - not the IDE or development
environment.
 
>> and based on my knowledge and experience, even when we disagree.
 
> I think the problem here is this is a C forum, and you're
> giving advice based on how C does things.
 
(It has ended up in the C++ newsgroup, but that is a minor detail.)
 
You have positioned CAlive as a "next generation C", or "evolved C", or
some kind of replacement for C. Of course its comparison to C is
relevant. C is our common language for reference - it would not help
you much if I compared it to Forth, or Haskell. And it is an imperative
programming language with a similar structure to C - a comparison to
other imperative languages, such as Pascal, might be useful if you like.
 
I think C is a fine programming language, and I have used it happily for
many projects. However, I think that if I were designing a new language
to handle similar tasks, there are many things I would do differently -
hindsight is an excellent tool. But I also think there are many things
I would keep the same.
 
Since you are targeting CAlive as a language related to C, or covering
some of the uses of C, it makes sense to discuss them.
 
nobody@example.org (Scott): Sep 19 04:23PM

On Wed, 19 Sep 2018 11:01:45 -0400, "Rick C. Hodgin"
> prinf("b is (a, c)\nc is (b, d)\n");
 
> if (a < b < c < d < e)
> prinf("b is (a, c)\nc is (b, d)\nd is (c, e)\n");
...
 
What nonsense are you trolling about now? Everybody knows that these
are already perfectly valid constructs in C with simple and
unambiguous semantics.
Ike Naar <ike@iceland.freeshell.org>: Sep 19 05:10PM


> if (a < b < c < d < e)
> prinf("b is (a, c)\nc is (b, d)\nd is (c, e)\n");
 
> Et cetera... Each evaluated left-to-right.
 
It would break existing code, for instance
 
0 < 1 == 0 < 1
 
is parsed (in current C) as
 
(0 < 1) == (0 < 1)
 
which evaluates to 1 (true).
According to your proposal it would be parsed as
 
(0 < 1) && (1 == 0) && (0 < 1)
 
which evaluates to 0 (false).
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 19 01:32PM -0400

On 9/19/2018 1:10 PM, Ike Naar wrote:
> According to your proposal it would be parsed as
 
> (0 < 1) && (1 == 0) && (0 < 1)
 
> which evaluates to 0 (false).
 
No. This new syntax would only work with forms which are con-
sistent with < or <= operators across from left-to-right, and
I would also probably place a constraint on it that they be
either stand-alone in an expression, or enclosed with paren-
thesis.
 
It would not include other operators like !=, ==, > or >=.
 
For CAlive I would probably also include <# and <=#, where the
# indicates that the comparison should only be done to so many
decimal digits:
 
float#2 fVal1;
float#4 fVal2;
 
// These values will hold whatever they hold, but whenever
// it encounters a # operator (==#, <#, <=#, >#, >=#), it
// will only conduct the comparison out to the minimum of
// the indicated decimal places
 
--
Rick C. Hodgin
bitrex <user@example.net>: Sep 19 01:43PM -0400

On 09/19/2018 12:23 PM, Scott wrote:
 
> What nonsense are you trolling about now? Everybody knows that these
> are already perfectly valid constructs in C with simple and
> unambiguous semantics.
 
it's ambiguous enough in that gcc emits a warning:
 
"warning: comparisons like X <= Y <= Z do not have their mathematical
meaning [-Wparenthesis]"
 
that is to say if (a <= b < c) will evaluate to if ((a <= b) < c) -> if
((bool) < c) which is probably not what you want, you often want if (a
<= b && b < c)
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 19 01:53PM -0400

On 9/19/2018 1:32 PM, Rick C. Hodgin wrote:
> I would also probably place a constraint on it that they be
> either stand-alone in an expression, or enclosed with paren-
> thesis.
 
 
I could define it to require braces, so it would then also
work with C/C++ because they could add those features as
well:
 
if ({a < b < c})
printf("b is (a,c)\n");
 
if ({a < b < c < d} || a+b+c+d == 0)
printf("...\n");
 
That might work.
 
--
Rick C. Hodgin
Keith Thompson <kst-u@mib.org>: Sep 19 11:18AM -0700

bitrex <user@example.net> writes:
[...]
 
> that is to say if (a <= b < c) will evaluate to if ((a <= b) < c) -> if
> ((bool) < c) which is probably not what you want, you often want
> if (a <= b && b < c)
 
A small quibble: C's equality and relational operators yield a
result of type int with the value 0 or 1, not a bool (or _Bool).
(In C++ they yield a result of type bool.)
 
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 19 08:22PM +0100

On 19/09/2018 18:53, Rick C. Hodgin wrote:
 
>     if ({a < b < c < d} || a+b+c+d == 0)
>         printf("...\n");
 
> That might work.
 
Nobody is interested in this fucktarded idea of yours mate so give it a rest.
 
/Flibble
 
--
"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."
jacobnavia <jacob@jacob.remcomp.fr>: Sep 19 10:26PM +0200

Le 19/09/2018 à 21:22, Mr Flibble a écrit :
 
> Nobody is interested in this fucktarded idea of yours mate so give it a
> rest.
 
> /Flibble
 
This guy is trolling since several YEARS about his new "language"... He
has NEVER presented ANYTHING that actually runs, all that is VAPORWARE
that is trying to hide the fact that he is spamming these newsgroups
with religious shit!!!
 
But there are ALWAYS people that answer his supposedely "technical"
questions...
 
DO NOT FEED THE TROLLS DAMM IT!
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 19 04:41PM -0400

On 9/19/2018 4:26 PM, jacobnavia wrote:
> NEVER presented ANYTHING that actually runs, all that is VAPORWARE that is
> trying to hide the fact that he is spamming these newsgroups with religious
> ..!!!
 
CAlive is a complex project. It's actually one part of a much
larger complex project. My goals are not to just create CAlive,
but to create a framework which works for CAlive, and then allows
me and others to rapidly port other languages to it, with all of
them inheriting the same benefits that will first be seen in
CAlive.
 
> But there are ALWAYS people that answer his supposedely "technical" questions...
 
> DO NOT FEED THE TROLLS DAMM IT!
 
Perhaps I'm not a troll, rude and mean Jacob.
 
--
Rick C. Hodgin
bitrex <user@example.net>: Sep 19 12:15PM -0400

On 09/19/2018 12:04 PM, Rick C. Hodgin wrote:
> ing "go to the Bible and see for yourself, go to local Bible-be-
> lieving churches and speak to born again people there for yourself."
 
> I do not argue with people.  I teach.
 
I'll tell you honestly Rick I felt bad about bailing on you the other
day. I don't feel comfortable discussing here why I made my decision to
consider myself Christian, sorry. I believe the Gospels to be true. As
for the reasons why exactly it was not because of your preaching, sorry.
:) But I just know.
bitrex <user@example.net>: Sep 19 12:21PM -0400

On 09/19/2018 12:15 PM, bitrex wrote:
> consider myself Christian, sorry. I believe the Gospels to be true. As
> for the reasons why exactly it was not because of your preaching, sorry.
> :) But I just know.
 
And I also know that since I understood myself to be a sinner and asked
Christ for forgiveness and started living a different way my life has
improved markedly in most respects. I really did feel like some great
weight I'd carried much of my life had been lifted, indeed. I felt free.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 19 01:35PM -0400

On 9/19/2018 12:15 PM, bitrex wrote:
> don't feel comfortable discussing here why I made my decision to consider
> myself Christian, sorry. I believe the Gospels to be true. As for the reasons
> why exactly it was not because of your preaching, sorry. :) But I just know.
 
To my knowledge, nobody ever has come to accept Christ by my teaching.
That doesn't mean I'm going to cease. It is the proper thing to do.
 
Remember, Peter, John and the others in the boat had been fishing all
night long and caught nothing, but when Jesus said to toss their nets
out to the right side of the boat, they brought up so many fish they
could not haul it in.
 
It's not up to us to convert people. That's the work of God's Holy
Spirit on the inside of people. It is up to us to teach.
 
--
Rick C. Hodgin
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 19 01:36PM -0400

On 9/19/2018 12:21 PM, bitrex wrote:
> Christ for forgiveness and started living a different way my life has
> improved markedly in most respects. I really did feel like some great weight
> I'd carried much of my life had been lifted, indeed. I felt free.
 
Me too. In fact, I could not believe what happened to me. And if
it hadn't happened to me, there's no amount of talking about it or
explaining by example which could've convinced me the person had
anything other than a psychotic breakdown.
 
It really is a totally new life brought to bear upon all that you are.
 
--
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 19 08:20PM +0100

On 19/09/2018 18:36, Rick C. Hodgin wrote:
> it hadn't happened to me, there's no amount of talking about it or
> explaining by example which could've convinced me the person had
> anything other than a psychotic breakdown.
 
Occam's Razor mate. You did have a psychotic breakdown and as you refuse
to accept that fact and take the required medication you still have these
delusions.
 
/Flibble
 
--
"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."
bitrex <user@example.net>: Sep 19 03:43PM -0400

On 09/19/2018 01:36 PM, Rick C. Hodgin wrote:
> explaining by example which could've convinced me the person had
> anything other than a psychotic breakdown.
 
> It really is a totally new life brought to bear upon all that you are.
 
I was very proud for a long time, a true skeptic, Occam's razor, all the
answers. I even said the usual lines myself.
 
"And, lo, the angel of the Lord came upon them, and the glory of the
Lord shone round about them: and they were sore afraid."
 
it all kinda collapsed like a house of cards, and I knew _real_ terror.
Like that.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 19 03:47PM -0400

On 9/19/2018 3:43 PM, bitrex wrote:
> shone round about them: and they were sore afraid."
 
> it all kinda collapsed like a house of cards, and I knew _real_ terror. Like
> that.
 
Absolutely. When the spirit nature enters into your life, a part
of you that had never given you a voice previously awakens, and
it drives you in ways nothing else can do.
 
People often have religion, and do things because they read it in
the Bible and they strive to follow it. But the new spirit nature,
and God's Holy Spirit guidance, it's like your whole general de-
meanor, purpose, and attitude toward life, is completely re-written.
You have this natural desire to love the things you used to hate,
and hate the things you used to love.
 
I still am jaw-dropped by it 14+ years later. It's truly not "me,"
but it is Him living inside of me. I keep trying to do things to
make me fail, but He keeps guiding my weak flesh back to Him.
 
It's not religion. It's that personal relationship. And it's
truly astounding to me even these many years later.
 
--
Rick C. Hodgin
bitrex <user@example.net>: Sep 19 04:00PM -0400

On 09/19/2018 03:47 PM, Rick C. Hodgin wrote:
> meanor, purpose, and attitude toward life, is completely re-written.
> You have this natural desire to love the things you used to hate,
> and hate the things you used to love.
 
I find it hard to hate in the way I once did. what is even one man's
anger at whatever it is. it's so puny and tiny compared to Christ's
love. it's nothing! Haha
 
Ian Collins <ian-news@hotmail.com>: Sep 20 08:04AM +1200

On 20/09/18 00:22, Rick C. Hodgin wrote:
> from which you proceed regarding faith. The things you've seen
> in the past with regards to faith which are ridiculous /ARE NOT
> WHAT GOD CALLS US TO BE A PART OF/.
 
Do I? You appear to be very selective in your acceptance of science.
If it is of benefit to you, you accept it, if it disagrees with your
views, you reject it.
 
If a group of researchers came up with a treatment for a mental illness,
you would accept it but if the same group, though the same process,
concluded that sexuality is part of who we are from birth, you would
reject it.
 
--
Ian
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 19 04:38PM -0400

On 9/19/2018 4:04 PM, Ian Collins wrote:
> You appear to be very selective in your acceptance of science. If it
> is of benefit to you, you accept it, if it disagrees with your views, you
> reject it.
 
That's untrue. What I do reject is the explanation that goes
against God being the creator and the designer of things. I
also look at evidence you ignore and place value on it, such
as there being many findings of soft tissue in dinosaur fossils
that are allegedly 65M+ years old. Some of them have viable
DNA fragments, and DNA is simply too fragile to last more than
a few thousand years.
 
> If a group of researchers came up with a treatment for a mental illness, you
> would accept it but if the same group, though the same process, concluded
> that sexuality is part of who we are from birth, you would reject it.
 
Yes, because I know from the Bible's teachings, from personal ex-
perience, and from testimonies I've seen, that it is the evil
spirit influence that draws a person toward sin.
 
It's the same with addictions. There are physical components,
but those physical components stem back to a spiritual component
which is affecting the flesh. Remove the spiritual component,
and the physical component either goes away or diminishes signif-
icantly.
 
--
Rick C. Hodgin
Jorgen Grahn <grahn+nntp@snipabacken.se>: Sep 19 08:09PM

On Wed, 2018-09-19, David Brown wrote:
> On 19/09/18 16:29, Tim Rentsch wrote:
>> Real Troll <real.troll@trolls.com> writes:
...
>>> Also Linux or pronounced differently.
 
>> I have heard that Linus Thorvalds pronounces "Linux" with a short
>> i, like the word "in", and so that's how I pronounce it.
 
Not sure that's correct ... people in Sweden pronounce both Linus and
Linux with a fairly long i, like "lean".
 
People speaking Swedish in Finland tend to stretch and stress the
first syllable even more, which is why Tove Jansson's likeable
Mumin character has his name spelled "Moomin" in translation.
 
Not that I think it's important, and I haven't listened to ; see below:
 
> gather Americans sometimes pronounce the name with "i" like in "eye",
> but I would say the "correct" pronunciation of the name Linus, and thus
> Linux, should follow the Finnish version.
 
I think what matters is (1) communicating well and (2) signalling
membership in a group of like-minded and cool people. Keeping track
of official pronunciation is less important.
 
Besides, in some sense it's an honor to have your name translated.
I pronounce Emacs like it was a swedish word because it's been my
favorite editor for 25 years; I pronounce vi the official way and
don't use it that much :-)
 
Everyone around here uses native pronounciation for: C, C++, Java, but
not for BASIC, C#, Ruby. Python: about fifty-fifty.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
scott@slp53.sl.home (Scott Lurndal): Sep 19 08:14PM

>>> i, like the word "in", and so that's how I pronounce it.
 
>Not sure that's correct ... people in Sweden pronounce both Linus and
>Linux with a fairly long i, like "lean".\
 
And that's how he pronounces his name (leeenus). But his OS
is pronounced linux (like "linen").
Tim Rentsch <txr@alumni.caltech.edu>: Sep 19 10:43AM -0700

>> redundant namespace names peppered all over the text, as background.
 
> You're either joking, or you greatly underestimate how differently
> people read and think about code.
 
I don't want to be pulled into this debate, but there is a point
about Alf's comment that I think deserves clarifying. What he
said is he would be surprised "if Mother Nature has evolved
people so that ...". I read his comments as saying he accepts,
at least provisionally, that different people perceive the
relative readability (of the two cases) differently. What he
doubts is that such reactions are innate behavior, as opposed to
learned behavior. A good example is the direction of writing.
I find it very much easier to read text that is written left-to-
right, as opposed to right-to-left. Some other people are
exactly the opposite of that. Surely though most of that is
learned behavior rather than innate behavior: if I had grown
up learning to read right-to-left that would seem natural to me,
and reading left-to-right would seem strange and difficult. Is
the same true for using, or not using, std:: everywhere? I
think it's hard to make a convincing argument that a preference
either way is innate behavior more than it is learned behavior.
Of course, it still might be true, but I don't see any compelling
reason why it should be true. And if it is learned behavior,
then clearly different people may reasonably have different
views on the relative readabilities of the two approaches.
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: