The preprocessor is just a pass

J

James Kanze

"James Kanze" <[email protected]> wrote in message
On Jun 1, 10:44 pm, "JohnQ" <[email protected]>
wrote:
On May 30, 6:22 am, "JohnQ" <[email protected]>
wrote:
" [It would help if you'd use standard Internet protocol
citations. It's hard to follow who says what in your
postings.]"
For some reason, my newsgroup reader doesn't insert the >
symbols in certain responses (on yours for instance!). I don't
know why!
"Then it's time to change newsreaders. Even Google gets this
right."
I'll keep an eye on it now, but I think it may only be happening
in response to your posts.

No one else seems to have that problem.
"Most programs are IO bound, and of course, they won't use
optimization. But you don't have to be in scientific computing
to find exceptions."
So, optimization can be avoided is what you're saying.

Sure. In practice, you don't activate optimization unless you
need it. Many systems are IO bound, and there's no point in
being complicated when you don't have to be.
"But you don't have any more guarantees. I'm most familiar with
the Posix environment, and Posix compliant compilers give the
guarantees you need, regardless of optimization. If you don't
want things like write order rearranged, you need special
hardware instructions---the compiler inserts these where needed
according to the guarantees it gives, and not otherwise.
Regardless of the level of optimization."
That's the theory at least.

In practice, as well.

Optimization is an additional complication for the compiler, and
so does increase the risk of error. But that's independant of
multi-threading or not---I don't think I've ever seen a case
where optimization caused a threading problem that wasn't
already there before.
Better safe than sorry. Turning on optimization for testing
whether funny things happen is a good idea though.
[...]
"It's really purely annecdotal, and certainly has no effect on
how you write C++ or develop programs. (That doesn't mean that
it is uninteresting. Just that it doesn't have any real
financial value, that a company would pay for.)"
Building a compiler for a new language?
"I don't know many companies in that business:). But seriously,
you don't hire beginners for that. You hire people who know
compilers."
Isn't it dependendent on how complex the language is?

Certainly. It takes about six man-months to develop a C
compiler front-end (without optimizer); I'd guess off hand that
it takes at least four times that for C++, maybe even a lot
more.
Are front ends or back ends harder to create?

They're different. A good optimizer can be extremely difficult.
The real difference, perhaps, is that having chosen your
language, you've chosen the complexity of the front end; the
complexity of what follows depends largely on how much you want
to optimize. Traditionally, you'd count on about two man-months
to develop a simple back-end, but on a modern pipelined
architecture, such a back-end is likely to have very poor
performance.
Don't both of those exist premade already (EDG?).

EDG will sell you a front end for some languages, probably for a
lot, lot less than it would cost you to develop it yourself.
There are still reasons why some compilers don't use it,
however: g++, of course, because it is not GPL; Sun and
Microsoft, probably because they want to maintain more control
in house; other companies for perhaps other reasons.
 
J

JohnQ

"James Kanze" <[email protected]> wrote in message
On Jun 1, 10:44 pm, "JohnQ" <[email protected]>
wrote:
On May 30, 6:22 am, "JohnQ" <[email protected]>
wrote:
" [It would help if you'd use standard Internet protocol
citations. It's hard to follow who says what in your
postings.]"
For some reason, my newsgroup reader doesn't insert the >
symbols in certain responses (on yours for instance!). I don't
know why!
"Then it's time to change newsreaders. Even Google gets this
right."
I'll keep an eye on it now, but I think it may only be happening
in response to your posts.

"No one else seems to have that problem."

Weird huh?
"Most programs are IO bound, and of course, they won't use
optimization. But you don't have to be in scientific computing
to find exceptions."
So, optimization can be avoided is what you're saying.

"Sure. In practice, you don't activate optimization unless you
need it. Many systems are IO bound, and there's no point in
being complicated when you don't have to be."

Well that was part of _my_ point to begin with.
"But you don't have any more guarantees. I'm most familiar with
the Posix environment, and Posix compliant compilers give the
guarantees you need, regardless of optimization. If you don't
want things like write order rearranged, you need special
hardware instructions---the compiler inserts these where needed
according to the guarantees it gives, and not otherwise.
Regardless of the level of optimization."
That's the theory at least.

"In practice, as well."

You're making the assumption that the additional complexity of
optimization added on top of the non-optimizing compiler does
not introduce any more potential for error (MT case or other).
I would err toward the risk-averse side OTOH.

"Optimization is an additional complication for the compiler, and
so does increase the risk of error. But that's independant of
multi-threading or not---I don't think I've ever seen a case
where optimization caused a threading problem that wasn't
already there before."

OK, you agree then, good. Same thought exactly.
Better safe than sorry. Turning on optimization for testing
whether funny things happen is a good idea though.
[...]
"It's really purely annecdotal, and certainly has no effect on
how you write C++ or develop programs. (That doesn't mean that
it is uninteresting. Just that it doesn't have any real
financial value, that a company would pay for.)"
Building a compiler for a new language?
"I don't know many companies in that business:). But seriously,
you don't hire beginners for that. You hire people who know
compilers."

**********************

Isn't it dependendent on how complex the language is?

Certainly. It takes about six man-months to develop a C
compiler front-end (without optimizer); I'd guess off hand that
it takes at least four times that for C++, maybe even a lot
more.
Are front ends or back ends harder to create?

They're different. A good optimizer can be extremely difficult.
The real difference, perhaps, is that having chosen your
language, you've chosen the complexity of the front end; the
complexity of what follows depends largely on how much you want
to optimize. Traditionally, you'd count on about two man-months
to develop a simple back-end, but on a modern pipelined
architecture, such a back-end is likely to have very poor
performance.
Don't both of those exist premade already (EDG?).

EDG will sell you a front end for some languages, probably for a
lot, lot less than it would cost you to develop it yourself.
There are still reasons why some compilers don't use it,
however: g++, of course, because it is not GPL; Sun and
Microsoft, probably because they want to maintain more control
in house; other companies for perhaps other reasons.
</QUOTE>

So, ... if I have a "simpler language" and don't need optimization,
my implementation costs will be WAY less (than C or C++,
especially the latter). :) The ideal would be to be able to feed
a grammar, or better yet, parameters, to a tool and have it spit out
the compiler: an end to "languages of great complexity"? There's
a research potential: "Investigation of Parametric Language
Specification and Implications on Compiler Generation". The
intermediate code for the purposes of the research could be C++
(actually, very controlled constructs and usage of C++).

John
 
J

JohnQ

"James Kanze" <[email protected]> wrote in message
On Jun 1, 10:44 pm, "JohnQ" <[email protected]>
wrote:
On May 30, 6:22 am, "JohnQ" <[email protected]>
wrote:
" [It would help if you'd use standard Internet protocol
citations. It's hard to follow who says what in your
postings.]"
For some reason, my newsgroup reader doesn't insert the >
symbols in certain responses (on yours for instance!). I don't
know why!
"Then it's time to change newsreaders. Even Google gets this
right."
I'll keep an eye on it now, but I think it may only be happening
in response to your posts.

"No one else seems to have that problem."

I tried to find another post/poster in which OE 6 wouldn't put the '>'
symbol in front of the lines but I couldn't find any. Your posts are the
only ones that cause the anomaly. FYI.

John
 
J

James Kanze

"James Kanze" <[email protected]> wrote in message
On Jun 5, 7:34 pm, "JohnQ" <[email protected]>
wrote:
On May 30, 6:22 am, "JohnQ" <[email protected]>
wrote:
" [It would help if you'd use standard Internet protocol
citations. It's hard to follow who says what in your
postings.]"
For some reason, my newsgroup reader doesn't insert the >
symbols in certain responses (on yours for instance!). I don't
know why!
"Then it's time to change newsreaders. Even Google gets this
right."
I'll keep an eye on it now, but I think it may only be happening
in response to your posts.
"No one else seems to have that problem."
I tried to find another post/poster in which OE 6 wouldn't put the '>'
symbol in front of the lines but I couldn't find any. Your posts are the
only ones that cause the anomaly. FYI.

So what is non-conformant in my posts? If nothing, then you
probably have to change newsreaders.
 
J

JohnQ

"James Kanze" <[email protected]> wrote in message
On Jun 5, 7:34 pm, "JohnQ" <[email protected]>
wrote:
On May 30, 6:22 am, "JohnQ" <[email protected]>
wrote:
" [It would help if you'd use standard Internet protocol
citations. It's hard to follow who says what in your
postings.]"
For some reason, my newsgroup reader doesn't insert the >
symbols in certain responses (on yours for instance!). I don't
know why!
"Then it's time to change newsreaders. Even Google gets this
right."
I'll keep an eye on it now, but I think it may only be happening
in response to your posts.
"No one else seems to have that problem."
I tried to find another post/poster in which OE 6 wouldn't put the '>'
symbol in front of the lines but I couldn't find any. Your posts are the
only ones that cause the anomaly. FYI.

"So what is non-conformant in my posts?"

I don't know. Maybe nothing. But obviously something is different about them
since I can't find anyone else's posts that causes the same anomaly. It
could be my OE 6 or the default settings. I dunno. But since it's only your
posts that are causing it, I tend to think you have some kind of "special
setup" on your end. Do you? I mean are you using something bizarre or do you
have something setup "specially"? From your post headers, I see the extended
ASCII character set is being used. That's a shot in the dark, but I can see
how that could maybe be an issue possibly. Why not use just 7-bit ASCII (is
it an option?)? I don't know what NNTP expects, but I do know that Windoze
has it's own interpretation of "extended ASCII" (Latin-1).

"If nothing, then you probably have to change newsreaders."

You say that so casually. If I was a heavy user of USENET, I might seek out
another program. I used to use Gravity a loooong time ago, but I'm not going
to change up now because I use newsgroups so lightly right now.

If you wanna go back and forth on this issue, we should take it out of the
group bandwidth probably.

John
 
J

James Kanze

"James Kanze" <[email protected]> wrote in message
On Jun 1, 10:44 pm, "JohnQ" <[email protected]>
wrote:
On May 30, 6:22 am, "JohnQ" <[email protected]>
wrote:
" [It would help if you'd use standard Internet protocol
citations. It's hard to follow who says what in your
postings.]"
For some reason, my newsgroup reader doesn't insert the >
symbols in certain responses (on yours for instance!). I don't
know why!
"Then it's time to change newsreaders. Even Google gets this
right."
I'll keep an eye on it now, but I think it may only be happening
in response to your posts.
"No one else seems to have that problem."
I tried to find another post/poster in which OE 6 wouldn't put the '>'
symbol in front of the lines but I couldn't find any. Your posts are the
only ones that cause the anomaly. FYI.
"So what is non-conformant in my posts?"
I don't know. Maybe nothing. But obviously something is
different about them since I can't find anyone else's posts
that causes the same anomaly.

So what's different?
It could be my OE 6 or the default settings. I dunno. But
since it's only your posts that are causing it, I tend to
think you have some kind of "special setup" on your end. Do
you?

If you think that Google is a "special setup". (It is, in many
ways, but I don't think I'm the only one posting through
Google.)
I mean are you using something bizarre or do you have
something setup "specially"? From your post headers, I see the
extended ASCII character set is being used. That's a shot in
the dark, but I can see how that could maybe be an issue
possibly. Why not use just 7-bit ASCII (is it an option?)?

Because it doesn't have all of the characters I need. Check out
me .sig---there are accents in my address.

Note that from what little I can see, Google translates what I
send into UTF-8 anyway; what you see is NOT what I have on my
machines.
I don't know what NNTP expects, but I do know that Windoze
has it's own interpretation of "extended ASCII" (Latin-1).

That should be irrelevant. There shouldn't be any special
characters in my headers, and normally, there aren't any in the
body of my post. I'll modify my usually .sig for this one, so
there won't be any special characters there, either, and we'll
see.
"If nothing, then you probably have to change newsreaders."
You say that so casually.

IF it's not conform, you shouldn't be using it. It's not like
you don't have a choice.
If I was a heavy user of USENET, I might seek out another
program. I used to use Gravity a loooong time ago, but I'm not
going to change up now because I use newsgroups so lightly
right now.
If you wanna go back and forth on this issue, we should take
it out of the group bandwidth probably.

Logically, yes, but since the problem only seems to appear when
you respond to my postings, it's a little difficult.

What you might try for starters is to send me an exact copy of
the last message you received from me (one that causes this
problem), including any headers. At least like that, I can see
if there is something unusual about what ends up under NNTP from
me (after Google has gotten through with it).
 
R

Ralf Goertz

James said:
On Jun 9, 7:13 am, "JohnQ" <[email protected]>
wrote:

That should be irrelevant. There shouldn't be any special
characters in my headers, and normally, there aren't any in the
body of my post. I'll modify my usually .sig for this one, so
there won't be any special characters there, either, and we'll
see.

That's odd. The message I am just replying has the header
Content-Type: text/plain; charset="iso-8859-1"

whereas the one I read immediately afterwards
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

although it has accented characters in your .sig and I can read them
probably because iso-8891-15 is my default reading character set. I
wonder if this depends on the server I use for reading your posts as
well?

Ralf
 
J

James Kanze

That's odd. The message I am just replying has the header
whereas the one I read immediately afterwards
<[email protected]> contains
although it has accented characters in your .sig and I can read them
probably because iso-8891-15 is my default reading character set. I
wonder if this depends on the server I use for reading your posts as
well?

That is wierd. My local set-up is supposed to use ISO 8859-1.
The message you are replying to was sent from home; perhaps the
other was sent from work, and there is something different in
the way Firefox is set up there. I notice that in my local
environment here, LC_CTYPE is set to "en_US". I'll check what
I've got set at work---I thought I was using "C", so that file
names would be sorted normally.
 
C

Clark Cox

That is wierd. My local set-up is supposed to use ISO 8859-1.
The message you are replying to was sent from home; perhaps the
other was sent from work, and there is something different in
the way Firefox is set up there. I notice that in my local
environment here, LC_CTYPE is set to "en_US". I'll check what
I've got set at work---I thought I was using "C", so that file
names would be sorted normally.

FYI this message also had a 'Content-Type: text/plain;
charset="us-ascii"' header. Perhaps this is (yet another) bug in Google
groups. *sigh*
 
D

Default User

Ralf said:
That's odd. The message I am just replying has the header


whereas the one I read immediately afterwards

As I recall, Google Groups uses quoted-printable in all replies. That's
been a on-going concern, especially when coupled with some version of
Outlook Express having a bug that doesn't quote those messages
correctly (leaves out the > ).




Brian
 
J

JohnQ

Headers from the post that works, followed by headers from a post that
causes the anomaly.

Here are the headers from the post that works:

Path:
newsdbm02.news.prodigy.net!newsdst02.news.prodigy.net!prodigy.com!newscon02.news.prodigy.net!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!p47g2000hsd.googlegroups.com!not-for-mail
From: James Kanze <[email protected]>
Newsgroups: comp.lang.c++
Subject: Re: The preprocessor is just a pass (OT: Problem responding to your
posts)
Date: Sat, 09 Jun 2007 19:37:47 -0000
Organization: http://groups.google.com
Lines: 103
Message-ID: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<Ly%[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
NNTP-Posting-Host: 86.70.189.206
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1181417867 4781 127.0.0.1 (9 Jun 2007 19:37:47
GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Sat, 9 Jun 2007 19:37:47 +0000 (UTC)
In-Reply-To: <[email protected]>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US;
rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1,gzip(gfe),gzip(gfe)
Complaints-To: (e-mail address removed)
Injection-Info: p47g2000hsd.googlegroups.com; posting-host=86.70.189.206;
posting-account=uN4QgA0AAAC_qk3WofNKjyjXNSBMXL2b
Xref: prodigy.net comp.lang.c++:962466
X-Received-Date: Sat, 09 Jun 2007 15:37:50 EDT (newsdbm02.news.prodigy.net)

Here are the headers from a post that causes the problem:

Path:
newsdbm02.news.prodigy.net!newsdst02.news.prodigy.net!prodigy.com!newscon02.news.prodigy.net!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!k79g2000hse.googlegroups.com!not-for-mail
From: James Kanze <[email protected]>
Newsgroups: comp.lang.c++
Subject: Re: The preprocessor is just a pass (OT: Problem responding to your
posts)
Date: Fri, 08 Jun 2007 09:25:45 -0000
Organization: http://groups.google.com
Lines: 42
Message-ID: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<Ly%[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
NNTP-Posting-Host: 62.160.54.162
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1181294746 26013 127.0.0.1 (8 Jun 2007 09:25:46
GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Fri, 8 Jun 2007 09:25:46 +0000 (UTC)
In-Reply-To: <[email protected]>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4)
Gecko/20070515 Firefox/2.0.0.4,gzip(gfe),gzip(gfe)
Complaints-To: (e-mail address removed)
Injection-Info: k79g2000hse.googlegroups.com; posting-host=62.160.54.162;
posting-account=uN4QgA0AAAC_qk3WofNKjyjXNSBMXL2b
Xref: prodigy.net comp.lang.c++:962209
X-Received-Date: Fri, 08 Jun 2007 05:25:46 EDT (newsdbm02.news.prodigy.net)
 
J

JohnQ

Yep! This post works.

John

James Kanze said:
"James Kanze" <[email protected]> wrote in message
On Jun 5, 7:34 pm, "JohnQ" <[email protected]>
wrote:
On Jun 1, 10:44 pm, "JohnQ" <[email protected]>
wrote:
On May 30, 6:22 am, "JohnQ" <[email protected]>
wrote:
" [It would help if you'd use standard Internet protocol
citations. It's hard to follow who says what in your
postings.]"
For some reason, my newsgroup reader doesn't insert the >
symbols in certain responses (on yours for instance!). I don't
know why!
"Then it's time to change newsreaders. Even Google gets this
right."
I'll keep an eye on it now, but I think it may only be happening
in response to your posts.
"No one else seems to have that problem."
I tried to find another post/poster in which OE 6 wouldn't put the '>'
symbol in front of the lines but I couldn't find any. Your posts are
the
only ones that cause the anomaly. FYI.
"So what is non-conformant in my posts?"
I don't know. Maybe nothing. But obviously something is
different about them since I can't find anyone else's posts
that causes the same anomaly.

So what's different?
It could be my OE 6 or the default settings. I dunno. But
since it's only your posts that are causing it, I tend to
think you have some kind of "special setup" on your end. Do
you?

If you think that Google is a "special setup". (It is, in many
ways, but I don't think I'm the only one posting through
Google.)
I mean are you using something bizarre or do you have
something setup "specially"? From your post headers, I see the
extended ASCII character set is being used. That's a shot in
the dark, but I can see how that could maybe be an issue
possibly. Why not use just 7-bit ASCII (is it an option?)?

Because it doesn't have all of the characters I need. Check out
me .sig---there are accents in my address.

Note that from what little I can see, Google translates what I
send into UTF-8 anyway; what you see is NOT what I have on my
machines.
I don't know what NNTP expects, but I do know that Windoze
has it's own interpretation of "extended ASCII" (Latin-1).

That should be irrelevant. There shouldn't be any special
characters in my headers, and normally, there aren't any in the
body of my post. I'll modify my usually .sig for this one, so
there won't be any special characters there, either, and we'll
see.
"If nothing, then you probably have to change newsreaders."
You say that so casually.

IF it's not conform, you shouldn't be using it. It's not like
you don't have a choice.
If I was a heavy user of USENET, I might seek out another
program. I used to use Gravity a loooong time ago, but I'm not
going to change up now because I use newsgroups so lightly
right now.
If you wanna go back and forth on this issue, we should take
it out of the group bandwidth probably.

Logically, yes, but since the problem only seems to appear when
you respond to my postings, it's a little difficult.

What you might try for starters is to send me an exact copy of
the last message you received from me (one that causes this
problem), including any headers. At least like that, I can see
if there is something unusual about what ends up under NNTP from
me (after Google has gotten through with it).

--
James Kanze (Gabi Software) email: (e-mail address removed)
Conseils en informatique orientee objet/
Beratung in objektorientierter Datenverarbeitung
9 place Semard, 78210 St.-Cyr-l'Ecole, France, +33 (0)1 30 23 00 34
 

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

Forum statistics

Threads
474,293
Messages
2,571,505
Members
48,192
Latest member
LinwoodFol

Latest Threads

Top