Are ++ and -- operators really more efficient

S

Stephen Sprunk

Malcolm said:
a * a * a

equals a^3 (^ is the exponentiation operator)

"^" is the exclusive-or operator in C, which is what this newsgroup is
about.

Knuth's exponentiation operator is "↑"; it is often written as "^" in
informal contexts where people are not able (or too lazy) to write "↑",
but in C contexts exponentiation should be written as "**" to avoid
confusion with exclusive-or. (And, IMHO, "**" should be added to C as a
native operator rather than requiring the use of pow().)

S
 
K

Keith Thompson

Stephen Sprunk said:
"^" is the exclusive-or operator in C, which is what this newsgroup is
about.

Since he clearly stated what he meant by it, I don't see much of a
problem. The topicality was at best marginal (though it followed from
a more topical discussion), but
Knuth's exponentiation operator is "↑"; it is often written as "^" in
informal contexts where people are not able (or too lazy) to write
"↑", but in C contexts exponentiation should be written as "**" to
avoid confusion with exclusive-or. (And, IMHO, "**" should be added
to C as a native operator rather than requiring the use of pow().)

That would be difficult to do, since the expression x**y is already
legal (it means x * (*y)). I agree that an exponentation operator
would be nice to have, though, particularly for doing exact integer
exponentation without having to convert to floating-point and back.
 
B

Ben Bacarisse

Keith Thompson said:
Falcon Kirtaran <[email protected]> writes:
Yes. You are welcome to pay it no attention, or to verify it. I'm not
really a fan of being impersonated.
[...]

Neither am I -- and I've been deliberately impersonated several times
recently in this newsgroup. I don't PGP-sign my messages because I
don't want to impose the clutter on the 99% of readers who aren't
going to bother to verify it. If I were going to post something of
earth-shattering importance, I might consider it.

There's another possibility that I've briefly considered, and that you
might want to consider yourself. If I cared enough, I might post
PGP-signed copies of my posts on a web site somewhere, and put the URL
(either for the site or for the individual message) in my signature.
Anyone who cared could verify the content, and anyone who didn't care
wouldn't be inconvenienced.

That gives only a one-sided guarantee -- everything you post up on the
page is something you stand by (and can be checked), but a forgery is
likely to have content that you'd want to deny posting. No one would
know if it is a forgery since you *could* have posted the message in
question and deliberately *not* put a copy on your website.

I'd very much like to see PGP signed messages become the norm. I am
happy to say what I wan to say in an attributable form, and I'd like
to have a reliably way to know who wrote what. Of course, I would not
know in the real-world sense of "who" but I would know that the same
identity posted a given set of messages and that filtering on an
identity would be reliable.
 
K

Keith Thompson

Ben Bacarisse said:
Keith Thompson said:
Falcon Kirtaran <[email protected]> writes:
Yes. You are welcome to pay it no attention, or to verify it. I'm not
really a fan of being impersonated.
[...]

Neither am I -- and I've been deliberately impersonated several times
recently in this newsgroup. I don't PGP-sign my messages because I
don't want to impose the clutter on the 99% of readers who aren't
going to bother to verify it. If I were going to post something of
earth-shattering importance, I might consider it.

There's another possibility that I've briefly considered, and that you
might want to consider yourself. If I cared enough, I might post
PGP-signed copies of my posts on a web site somewhere, and put the URL
(either for the site or for the individual message) in my signature.
Anyone who cared could verify the content, and anyone who didn't care
wouldn't be inconvenienced.

That gives only a one-sided guarantee -- everything you post up on the
page is something you stand by (and can be checked), but a forgery is
likely to have content that you'd want to deny posting. No one would
know if it is a forgery since you *could* have posted the message in
question and deliberately *not* put a copy on your website.

In that sense, a message that doesn't appear in a signed version on
the web site is no different from a posted message with no signature.
I could promise to sign every message I post, but I can't prove that a
sufficiently well-crafted forgery isn't mine unless there's some
mechanism to force me to sign everying I post -- and that's not going
to happen any time soon.
I'd very much like to see PGP signed messages become the norm. I am
happy to say what I wan to say in an attributable form, and I'd like
to have a reliably way to know who wrote what. Of course, I would not
know in the real-world sense of "who" but I would know that the same
identity posted a given set of messages and that filtering on an
identity would be reliable.

(And if, for example, Richard Heathfield had published his PGP
fingerprint in his book, we could be reasonably confident that it's
really his.)

I tend to agree. The problem is that most people aren't going to care
whether a message they're reading is properly signed, and for the vast
majority of users the signature is annoying garbage.

One solution (short of re-vamping the Usenet infrastructure, including
every newsreader) would be to find a way to put the signature in the
message header rather than in the body. If it used one or more
"X-...:" headers, existing newsreaders wouldn't display it by default.
The problem is that any software that makes any modification to the
content en route would invalidate the signature.
 
S

Spiros Bousbouras

Keith Thompson said:
Falcon Kirtaran <[email protected]> writes:
Yes. You are welcome to pay it no attention, or to verify it. I'm not
really a fan of being impersonated. [...]

Neither am I -- and I've been deliberately impersonated several times
recently in this newsgroup. I don't PGP-sign my messages because I
don't want to impose the clutter on the 99% of readers who aren't
going to bother to verify it. If I were going to post something of
earth-shattering importance, I might consider it.
There's another possibility that I've briefly considered, and that you
might want to consider yourself. If I cared enough, I might post
PGP-signed copies of my posts on a web site somewhere, and put the URL
(either for the site or for the individual message) in my signature.
Anyone who cared could verify the content, and anyone who didn't care
wouldn't be inconvenienced.

That gives only a one-sided guarantee -- everything you post up on the
page is something you stand by (and can be checked), but a forgery is
likely to have content that you'd want to deny posting. No one would
know if it is a forgery since you *could* have posted the message in
question and deliberately *not* put a copy on your website.

Your 2 sentences seem to be talking about 2 different
things. In the first sentence you address the issue of
denying a forgery. This can be done easily enough with the
scheme Keith proposes , he would only need to post the
denial on his website (and the group). Your second sentence
talks about a situation in which someone did post something
(so it's not a forgery) but he wants to deny that he posted
it. In such a situation even an in-post signature wouldn't
help because he could simply not include the signature or
include a false one. So signatures wouldn't help against
sockpuppets for example.
I'd very much like to see PGP signed messages become the norm. I am
happy to say what I wan to say in an attributable form, and I'd like
to have a reliably way to know who wrote what. Of course, I would not
know in the real-world sense of "who" but I would know that the same
identity posted a given set of messages and that filtering on an
identity would be reliable.

It might be a good idea if Usenet standards were updated to
accommodate this sort of thing. Is there any movement
towards such a direction ?
 
D

dj3vande

Falcon Kirtaran said:
Yes. You are welcome to pay it no attention, or to verify it. I'm not
really a fan of being impersonated.

I think you're answering the wrong question.
Do you really need to sign usenet posts with a key that generates 13
lines of signature data (plus the framing markers)? Even posts with
one or two lines of content? It seems to me that a signature longer
than the post is excessive.

I've just checked, and a standard 1024-bit DSA key generates three
lines of actual signature data (7 including the framing markers); The
simple step of generating a smaller key (and signing it with your full
key for authentication) would make the PGP signature a lot more
reasonable. If you're really concerned about the shorter key
length[1], expire the key after a year and generate a new one then.


dave

[1] You shouldn't be. The people who can break a 1024-bit key, if such
people exist, have better things to do with that ability than forge
usenet posts.
 
R

Richard

Richard Heathfield said:
Keith Thompson said:



I think you're over-stating the problem (although I can certainly
understand why, given the recent spate of forged posts).

If a sufficiently well-informed clc reader is incapable of
distinguishing between a KT original and a forgery, then the clc
reader is insufficiently well-informed. :)

Our current batch of trolls is a nuisance, sure - but the group is
in danger of allowing them to become a menace. Their intent is the
destruction of the group, but they can only achieve this if people

And you accuse Keith of over stating things? It seems the intent is
merely to dislodge bully boys like yourself and to broaden the scope a
little to more than how many bytes are in a word etc.
continue to give them (spurious) credence by continuing to reply to
their articles. If we all just take it as read that they're a bunch

Like the ones where they point out errors in your book? Or where they,
yet again, point out that Chuck Falconer doesn't know his arse from his
elbow?
of liars, what need is there to reply to any of them, or even to

Because Han and co are not liars. If you can point out lies from him on
the topic of C all well and good. I suspect you can't. This makes you
the liar and you the problem.
read them? Okay, so a few newbies might be misled for a while, but
this bunch is so unsubtle that any C programmer worth his or her
salt ought, without our help, to be able to suss them out as
frauds.

Scarily, I do believe you believe this yourself. So high is your own
self regard.
 
K

Keith Thompson

Richard Heathfield said:
Keith Thompson said:



I think you're over-stating the problem (although I can certainly
understand why, given the recent spate of forged posts).

I was merely speculating about how the problem might be solved, not
necessarily implying that it's sufficiently serious to justify such
action. Mostly my intent was to give Falcon Kirtaran an alternative
to signing his posted messages, though I may have gone off on a bit of
a tangent from that. In any case, I don't think I've seen any
forgeries recently.

[snip stuff I agree with]
 
A

Antoninus Twink

Our current batch of trolls is a nuisance, sure - but the group is in
danger of allowing them to become a menace. Their intent is the
destruction of the group

This is utter, utter bullshit. As always, Heathfield shows himself to be
a shameless LIAR.

"Their" intent is the rescue of the group.

The Topicality Taliban have brought the group to the verge of
destruction over the last few years. The average real-world C
programmer would feel completely marginalized here, so no wonder it
turned into an echo chamber for the regulars' discussions of void main()
and casting the return value of malloc(). There may have been lots of
posts, but most of them were the same people saying the same things to
an admiring audience of the same people with the same narrow horizons as
themselves.

A few posters would contribute interesting articles - Sossman and Pfapf,
for example - but the topicality zealots made sure that the group slowly
slipped further and further into irrelevance.

Far from "destroying" this group, the so-called "trolls" have given it a
new energy and sense of direction. As always, the vested interests of
the ancien regime mean that they resist the change aggressively, but
change will sweep them from their ISO thrones and usher in a golden-age
of frank real-world C discussions.

To quote the zeitgeist, "YES WE CAN!"
 
B

Ben Bacarisse

Spiros Bousbouras said:
Keith Thompson said:
Falcon Kirtaran <[email protected]> writes:
Yes. You are welcome to pay it no attention, or to verify it. I'm not
really a fan of being impersonated.
[...]
Neither am I -- and I've been deliberately impersonated several times
recently in this newsgroup. I don't PGP-sign my messages because I
don't want to impose the clutter on the 99% of readers who aren't
going to bother to verify it. If I were going to post something of
earth-shattering importance, I might consider it.
There's another possibility that I've briefly considered, and that you
might want to consider yourself. If I cared enough, I might post
PGP-signed copies of my posts on a web site somewhere, and put the URL
(either for the site or for the individual message) in my signature.
Anyone who cared could verify the content, and anyone who didn't care
wouldn't be inconvenienced.

That gives only a one-sided guarantee -- everything you post up on the
page is something you stand by (and can be checked), but a forgery is
likely to have content that you'd want to deny posting. No one would
know if it is a forgery since you *could* have posted the message in
question and deliberately *not* put a copy on your website.

Your 2 sentences seem to be talking about 2 different
things. In the first sentence you address the issue of
denying a forgery. This can be done easily enough with the
scheme Keith proposes , he would only need to post the
denial on his website (and the group). Your second sentence
talks about a situation in which someone did post something
(so it's not a forgery) but he wants to deny that he posted
it. In such a situation even an in-post signature wouldn't
help because he could simply not include the signature or
include a false one.

Yes, I was not very clear, to the point of not making the point I
wanted to. The real distinction is that one can deny a post later.
If, in anger I post "xxx", but after a few angry replied I choose to
deny it I can remove the copy on my web page provided no one has
copied it yet. If posts are signed, I have to decide when I post if I
really want to put my name to my words.

Since it is posts that one is responsible for, it is posts that should
be signed. I suppose that is the nub of what I am saying.

<snip
It might be a good idea if Usenet standards were updated to
accommodate this sort of thing. Is there any movement
towards such a direction ?

Sorry, I am not in that loop.
 
P

Phil Carmody

Keith Thompson said:
That would be difficult to do, since the expression x**y is already
legal (it means x * (*y)). I agree that an exponentation operator
would be nice to have, though, particularly for doing exact integer
exponentation without having to convert to floating-point and back.

Add to that unary minus precedence, and it's a minefield that simply
isn't worth heading towards.

Phil
 
K

Keith Thompson

Phil Carmody said:
Add to that unary minus precedence, and it's a minefield that simply
isn't worth heading towards.

I don't think unary minus precedence (whether -x**y means (-x)**y or
-(x**y)) is much of an issue. I've used languages that have a
built-in "**" exponentation operator. They just define the precedence
one way or the other, and careful programmers use parentheses.

Adding one more arbitrary precedence level to the 20 or so that we
already have just isn't that big a deal.

The symbol "^^" has been suggested. This wouldn't cause any
compatibility problems, and exponentiation is probably a better use
for this than a hypothetical short-circuit xor. :cool:} (Of course a
short-circuit xor is impossible, but a *logical* xor might make sense;
I just think exponentiation is more useful.)

But, like any proposed new feature, it has to overcome the
considerable cost of adding *any* new feature to a language whose
standard is already difficult to lift.
 
P

Phil Carmody

Keith Thompson said:
I don't think unary minus precedence (whether -x**y means (-x)**y or
-(x**y)) is much of an issue. I've used languages that have a
built-in "**" exponentation operator. They just define the precedence
one way or the other, and careful programmers use parentheses.

As long as you're only hanging around with just programmers, you're
fine. For my sins, I'm mostly in dialogue with mathematicians (in
the field of computational number theory, so they are programmers
too), and all hell would break loose were such an operator to appear,
and it were to not follow the mathematicians' convention.

Phil
 
C

CBFalconer

Stephen said:
.... snip ...

"^" is the exclusive-or operator in C, which is what this
newsgroup is about.

Knuth's exponentiation operator is "↑"; it is often written as
"^" in informal contexts where people are not able (or too lazy)
to write "↑", but in C contexts exponentiation should be written
as "**" to avoid confusion with exclusive-or. (And, IMHO, "**"
should be added to C as a native operator rather than requiring
the use of pow().)

Very good. Now explain how we describe a pointer to a pointer,
other that with **. Also note that your "↑" requires a
collection of three characters not available to the average
keyboard (or display). This makes its use somewhat questionable.
 
C

CBFalconer

Spiros said:
.... snip ...

It might be a good idea if Usenet standards were updated to
accommodate this sort of thing. Is there any movement
towards such a direction ?

Not a good idea. Once you make such incompatible (with history)
changes you lose half the readership. In general, they don't come
back. As it is we can detect, warn, PLONK, and generally deal with
the troublemakers.
 
C

CBFalconer

.... snip ...


I think you're answering the wrong question. Do you really need
to sign usenet posts with a key that generates 13 lines of
signature data (plus the framing markers)? Even posts with one
or two lines of content? It seems to me that a signature longer
than the post is excessive.

As an example the message itself could be passed through a CCITCRC
generator. The result is a 16 bit unsigned int, which can be
expressed in a 4 char hex display. That can go in the headers (as
an x-hdr). The sig marker can be used as a message end marker,
thus allowing some providers to append a marker of their own.

It is not perfect, and the script kiddies can obviously foul
things. But it will cut some things out, or at least alert to
their existence. It does assume 8 bit chars, or char expression.
 
S

Stephen Sprunk

CBFalconer said:
Very good. Now explain how we describe a pointer to a pointer,
other that with **.

That's a unary **; a binary ** would be exponentiation. Compilers have
no problem distinguishing unary * from binary *, so your complaint seems
to be without merit.
Also note that your "↑" requires a
collection of three characters not available to the average
keyboard (or display). This makes its use somewhat questionable.

It is a single character, U+2191. Your newsreader apparently doesn't
understand UTF-8. It was easy enough for me to find and type (and for
most of the other denizens here to read), but I did note that two
alternates that are much easier to type are in common use; one is
already taken in a C context, but the other is not.

S
 
B

Ben Bacarisse

CBFalconer said:
Not a good idea. Once you make such incompatible (with history)
changes you lose half the readership.

Eh? No one is suggesting that digital signing be mandatory (at least I
was not) so I don't see what is incompatible with history about
allowing signed posts.

I don't do it because I'd get shouted at for have "junk in my posts"
(and all sorts of other accusations) and there is no reply to that
because a digital signature, whilst accepted by lots of news readers,
is not considered proper netiquette.

If a new RFC stated that is was OK (or even desirable) to sign posts,
the those that want to could do so.
 
R

Richard

Ben Bacarisse said:
Eh? No one is suggesting that digital signing be mandatory (at least I
was not) so I don't see what is incompatible with history about
allowing signed posts.

I don't do it because I'd get shouted at for have "junk in my posts"
(and all sorts of other accusations) and there is no reply to that
because a digital signature, whilst accepted by lots of news readers,
is not considered proper netiquette.

If a new RFC stated that is was OK (or even desirable) to sign posts,
the those that want to could do so.

IMO Digital signatures on an obvious nym are nothing more than
showboating.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top