Where do I download Comeau compiler.

  • Thread starter Miroslaw Makowiecki
  • Start date
J

JohnQ

Greg Comeau said:
If one really wants to know what's really going on behind the scenes,
there is probably no term, because at that point exactly what
is going on is up to the particular implementation. So, sure,
then we're left with the terms we have.

I was suggesting that qualifying to _what_kind_ of compiling is in order. As
in "compiling to C" (which is of course incorrect, but an example).
"compiling to intermediate form" seems reasonable evolution of the
terminology, to me. Compared to the traditional usage: "compiling to .obj".
I'm wholly OK with your previous post and Bjarne's description of cfront as
"a compiler". As in, "compile to intermediate form". Moreso, I like it much
better than "compile to .obj" which completely ignores the in-between steps.
The way I see it, once you have the (proprietary) intermediate form (symbol
tables etc.), from there you can generate whatever you want to: object code,
C code, whatever. But I'd call going from intermediate form to something
else "translation" or something similar. At this juncture, I'm thinking that
"compiling" _should_ refer to "from source to intermediate form" and it has
sub phases such as preprocessing, syntax checking, semantic analysis, etc.

John
 
J

JohnQ

Greg Comeau said:
You're starting to loose me, but I'll try: compiling does include those
things, but compiling (in the case of compiling) is the translation act.
And yes, I guess it's valid to say that there are subtranslations
occuring within that sometimes.

I made another post that more firmly describes how I'm thinking of the
process. So pick it up there if you want to and let this tangential
subthread end. (I actually refer to the stuff in this subthread there).

John
 
G

Greg Comeau

"The standard doesn't really speak of "compiling" formally. It
specifies how a C++ is translated to an executable file, then
executed. The translation has a certain number of steps;
classically, some of those have been considered "compiling",
where as the last has been considered "linking". But modern
systems tend to blur the distinction, and most systems today
also use a single command line for the works. Thus, for
example, g++ is not what would have been called a compiler when
I was learning computer science; it's a driver program which
invokes different phases of the compiler and/or the linker,
depending on command line options, etc."

"Depending on the context today, "compiling" can mean what you do
to go from one or more .cc files to an executable binary, or
what you do to go from a single .cc file to a single .o/.obj
file, with linking being a separate step (and I can't think of a
good, simple verb for "building a library"). Note that with
g++, I use the commands g++ and cl (under Windows) for both
compiling and linking, and with Sun CC, I use the command CC for
building a library as well (although I use ar with g++, and lib
with cl)."

See, now that's what I think of as "compiling" also: the traditional use of
the term.

I'm surprised about this whole thread then! :)
So, would you consider going from source code to an intermediate
form, doing semantic analysis and such along the way, compiling? (The
intermediate form being symbol tables and such).

I prefer to think of things as a "compiler system" with a
"compiler proper" as one part.
 
G

Greg Comeau

So there is no list of translation phases then (right?). I have the draft
standard, is the high level view of the phases discussed somewhere that you
know of and can point me to? If it's scattered all over the document without
overview though, that disuades me from diving into it. (I think you are
saying that it is scattered).

If I feel "ambitious" I'll open the pdf and skim through it looking for
relevant passages.

See section 2.1
Tell me this though, if you know: are the phases purposely not defined to
give implementations more leeway? As in, "anything can happen between
ingesting the source code and putting out the resulting obj file".

The phases are defined, just not the way you think :) Otherwise, yes,
that's part of what "leaves translation open" involves.
 
J

JohnQ

Greg Comeau said:
If it's an all encompassing carte blanche statement it probably is
pushing things, although there is still a point there.
However, chances are reasonable that even if you have a focused
look at things, you're using a multi-vendor solution, for instance,
a sub process which is invokes, or a library that is used, etc
(and yeah, I'm talking strickly about compiling).

Ha! I thought we were still trying to get a grip on what constitutes
"compiling".
It happens. Although I'm not sure that was that JK was saying,
although perhaps it was.

I just said it was rare.
Actually it can be "old fashion" and is compiler-specific
while at the same time striving for some commonality.
Let's leave it at that.

Or let's take a look at some of that generated "C"! ;)
(rhetorical request, as I kinda get that it's one of those never being
defineable places that a product has to deal with. I understand. _I_ sure
wouldn't be the one maintaining that (product) though! You have a complex
baby there.)
Partially, sure.

But read on, as I think your product emphasizes a PROBLEM with the C++
programming language.
So is doing it in assembler then :)

That was so cliche! Shame on you. Believe me, I can deal with deciding
whether a given project should be done in C or C++ given target platforms,
product future etc. I understand where your product fits the bill. If you
want to start promoting it out of the niche though that I think it belongs
in, then I'm a hard sell.
Anyway, no, as JK would then be saying using the same C compiler
which is not the same thing as what you just said (at least as
I'm reading it).

I can't grok that this Saturday night, so let's drop it if not of world
peace importance.
Because we can leverage off "C being available everywhere"
and use it as a portable assembler so to speak. And since C
vendors have tailored to specific CPUs etc, in their "back ends"
and that is hard, well, why should we?

I think your answer was: "because it's too hard". OK, I understand. Nothing
wrong with that. "Too hard" or "I don't wanna do that" are very fine
answers. One of the things that I don't want to do is security, for example.
It spreads me too thin and I find it immensely boring and unsatisfying. I've
always known I couldn't do it all myself. _MY_ issue is, that I don't trust
anyone and I keep my cards close to my chest. Maybe as a company, Comeau is
a little bit like that too. The thing is though, I don't think it can afford
to be. Just my .02.
I don't believe that is what JK is saying.

JK was putting all development components in one basket, if you ask me.
Using a database library is fundamentally different than interjection of
another compiler/vendor into the build process. So if I'm typing based on
paradigm, you keep letting me know.
Let's say Comeau was
a native compiler. JK's comments still remain in full force.

Whatever, I'm not going to go back and try and decipher what you mean. My
point: database library != major change in development process.
Delegating to C may be what we're doing as an implementation detail
but it's a moot aspect to JK's point, at least as I'm currently seeking
it.

Spell it out. I don't know what you mean. Don't be referential, just say
what you mean.
JK is not saying to make one implementation "THE C++".

I didn't say that. I pondered that outside of JK's comments. Twas my summary
of analysis of the state of things. JK has got nothing to do with it. (I
mean other than he may be rah-rahing a bit). Take the point: that C++ is so
complex that only very few gurus can produce conforming implementations.

Maybe I'm too practical or too idealist to use C++?
I don't hear anybody disagreeing with this.

Then recognize that as me becoming sensitized to that. (I know, this is a
LANGUAGE newsgroup: we talk about the standard here. I get it. I come here
because I need more info and can't use C++ blindly. When I was a kid, I took
my toys apart. Nuff said.)

You're right. (Were you agreeing with me??. Well then you were probably
wrong to do so. Hehe.)
I still don't hear anybody disagreeing.

I'm not going to go back in the posts/text to dig out my feelings contained
in those responses of mine. I probably meant them as "additional free info,
use it as you want".
If C++ ceased to exist from today onward, it would be among one of
the most amazing successes in software/languages/etc. Saying otherwise
is just plain wrong.

It was like open source software: it found masses. OK, that's a bit
facetious. C++ is old and tired. But unlike me, it needs to retire. Hmmm...
it's needs to have a baby. That is so uncanny.
Also, the demise of C++ has been hailed since its inception.
It has not happened. And the contrary happened, despite
poor initial marketing and many other obstacles. And yes,
it had many problems.


It's both. As above, let's leave it at that.


Now, *that's* silly :)

It totally escapes me why you think so.
Maybe I'm tired, but coding around something that can be automatic
seems contrary to what we're usually using computers for.

Ha! You wish.
Neither of these seems related to the discussion at hand,

Sure they do. For instance, I didn't need to wait for C++ to support _FUNC_.
If I need that functionality, I'll build it.
(Note that the _FUNC_ implementation ended up being less than I wanted so I
still use my own way. Is it in C++ yet?).
or in any case, are true across the board, and so should shake
out no matter what the compiler or language.
What??


There is a bit of both.

It's called "walking the fence", "being a politician", "marketing!", etc. :p
Stop that.
I'd love to see a new and better language than C++.

No you wouldn't. :p
It's a BIG drawing board. Do you have it ready yet? :)

Are you funding me yet? :p
But something of the opposite of that has always been the case with C++.

Please clarify what you mean.
So I'm going to say that what you just said it categorically false,
at least as I'm understanding it.

Oh, you don't understand it, but it is "categorically false". Did I push a
button? (rhetorical: probably many).

John
 
J

JohnQ

Greg Comeau said:
I'm surprised about this whole thread then! :)

It's probably because I'm learning stuff along the way. I _use_ C++, I don't
_implement_ it.
I prefer to think of things as a "compiler system" with a
"compiler proper" as one part.

I think I was asking JK, but OK. What you said though, probably in this day
needs more definition and can have it. (I mean, it's clear in my mind :) ).

John
 
J

JohnQ

Greg Comeau said:
See section 2.1

Thank you. I'll try to procrastinate there instead of "you have 30 minutes
left on your account with 'hotbabe online''".
The phases are defined, just not the way you think :)

Just tell me. It's not my "specialty". I won't buy it if I don't know how it
works (yeah, I know, I'm not the target market).
Otherwise, yes,
that's part of what "leaves translation open" involves.

OK. I don't like definitions. I think that way because a lot of things are
not define-able. This is tech stuff, and it can be defined and I won't
accept it being of importance. Ever.

You asked. I answered.

John
 
L

LR

JohnQ wrote:

See, now that's what I think of as "compiling" also: the traditional use
of the term. So, would you consider going from source code to an
intermediate form, doing semantic analysis and such along the way,
compiling? (The intermediate form being symbol tables and such).

I'm not sure I understand that.

"(The intermediate form being symbol tables and such)."

What makes you think that the intermediate form would include symbol
tables? For what reason? And what does "and such" include?

I always thought that the intermediate form would be code of some kind.

In the case of Comeau's compiler, C code. But no reason it couldn't be
something else. For example I understand that more recent versions of
Visual C++ compile to MSIL or CIL and from there to various native
machine codes. You may find this of interest:
http://en.wikipedia.org/wiki/MSIL



Not to say that a symbol table wouldn't be useful for, say, a cross
reference tool or something, but I don't see why it would be included in
the intermediate form.

But perhaps I'm wrong. What do you think the intermediate form is?

LR
 
J

James Kanze

That's a facetious argument. The window is that of compiling source code.

Not really. The window is building an executable from the
sources I wrote. In practice, of course, those sources are
almost never pure C++; who writes out complex table
initializations, when AWK can do it from a simple text file more
easily? Can you really say that you've created a serious C++
program in which none of the sources are automatically
generated? Can you really say that you don't use some sort of
source code control, and that your sources aren't necessarily
directly accessible from the compiler? That you don't use a
data base, or a third party windowing library, or any third
party connectivity software?
Pretend it's the last compile before packaging and deployment and not
everything from concept to purchasing shrink-wrapped sofware in a retail
store. But it's not worth talking about. If you think that exotic means of
Me: Using 2 compilers in a chain is for very specialized, very
non-mainstream development scenarios.
You: No it's not.

You're missing the point. If you use Comeau, that's the only
"compiler" you have in your chain. Comeau, of course, may use
other tools, but then, so does g++ on my Solaris machine.
That's Comeau's problem, not mine. And of course, a "compiler"
is simply not the only tool I have in my tool chain. I use lex,
yacc, awk, etc. for code generation. I use third party
libraries for data base accesses. I do depend on multiple
suppliers. I can't imagine any serious application which
didn't; you don't work in a vacuum, and you certainly aren't
going to redevelop everything yourself.
If you like to lump everything into one category, so be it.
Class hierarchy: development tools. Not much of a hierarchy
huh. (We were talking about compilers. USUALLY there is only
one).

I'm not sure I follow you. You seem to have created an
artificial category: compilers. The tools I use to "compile"
code are drivers which invoke multiple sub-tools. In some
cases, all of the sub-tools come from the same supplier, but not
always: g++ under Solaris uses the Sun linker, for example.

[...]
It just means that you are jobbing out the difference resolution to Comeau
instead of doing it yourself. Instead of dealing with differences in C++
implementations, you're letting Comeau deal with differences in C
implementations. Of course, doing it in C is an alternative also.

That's a more or less accurate way of describing it. Just as by
using a high level language, I'm jobbing out the differences in
machine architecture, and by using a commercial database, I'm
jobbing out the incredible amount of work which would be
necessary to write one myself. Anytime I can job work out, I
win.
Comeau will get the code to something platform-specific but not
hardware-specific. That's why I consider it a "front end". Which begs the
question: "Why doesn't Comeau put a back end on it for each platform and
sell a "real" compiler?

The real question is: why should they? They have something
which works. They make it available at a very reasonable cost.
If Greg had to write (or pay someone to write) a machine code
back-end for each platform, the compiler would cost more. Just
as I use a commercial database, rather than write my own,
because I get a lot better product a lot cheaper that way, Greg
lets the specialists in each machine architecture provide the
back-end for that architecture.
Nah, it's bad all around (note JohnQ jumping out of the hot
oil): C++ should be implementable.

It is. EDG has done so, and it certainly has a lot less
resources that companies like MS or Sun.
If it is so bad that one cannot trust that code can be
written to be compiled on any compiler, something else is VERY VERY wrong.

Something is very, very wrong. Some suppliers have chosen to
ignore the standard, for whatever reasons, and just implement
the parts of it which interest them. Often with in house
extensions added to it.
1. I think the importance of standard conformance is over-blown relative to
all development issues.

That's probably because you've never had to develop professional
level code. What do you base your language understanding on, if
not the standard? You have a choice: standard conformance, or
vendor lock in and unportability.

[...]
I think a better approach is to know what the issues are and then code
around them.

In theory, you're right. In practice, you have no means of
really knowing in advance what all of the issues are going to
be. Compiler vendors don't advertise up front that they don't
actually do some things correctly.

[...]
Aside: Now may be a good opportunity to list the things (conformance
issues?) that may be of enormous concern to developers that Comeau solves
and the other guys don't. What would be interesting also is a comparison of
where compilers are at today to where they were yesterday, against the Dr.
Dobb's article someone refernced earlier perhaps. I have a feeling that I'll
find the issues mostly remote/non-important.

You, maybe. You've already mentionned that you don't like or
use templates. If you don't like or use templates, then many of
the issues do disappear. As it happens, I'd like to use
templates, but most companies still forbid them at the
application level, because of portability problems. There are
things in Boost I'd like to use, but some companies still forbid
even the standard library, because of portability concerns (and
in fact, we've had problems recently when porting code from Sun
CC to g++, and vice versa).

Use Comeau and the Dinkumware libraries everywhere, and this set
of problems disappear. (Use C90, and they disappear as well.
Interestingly enough, use C99, and you run into exactly the same
sort of problems. Which sort of proves that the problem isn't
with the complexity of the language per se, but with the
decision of compiler vendors to more or less ignore the
standard, at least in part, and with compiler users to accept
this without complaint.)
Again, that's a (THE) problem with C++.

And C. And Fortran. In the past, it was always a serious
problem with Cobol---today, the only people using Cobol are on
IBM mainframes, so the problem has disappeared.
(Unless of course there are inclings
that the platforms are competing with languages with their own APIs and
therefor purposely avoid implementing certain language elements).

In at least one case (and no, I'm not thinking of Microsoft
here), it's very clear that the vendor would prefer that all
developments use his own language, rather than C++. More
generally, it is a question of allocation of resources, and it
would seem that most vendors, today, are more concerned with
somehow "locking you in", or at least supplying special platform
specific features, than being standard conformant. So that's
where they put their resources.
Now that IS a valid potential use, if one decides that "the
more compilers we run the code through the better". But again,
it's a fundamental language problem IMO.

A problem shared by most languages today, it would seem. (Ask
about support for C99 in comp.lang.c, for example.)
 
J

JohnQ

(Yeah, I know, I shouldn't drink so much. Sowwy. Let it go, let's move on).

That's a facetious argument. The window is that of compiling source code.

"Not really."

Yes, really. You're not thinking about moving into sales per chance, are
you??

"The window is building an executable from the
sources I wrote."

That's too big of a window. We can easily distinguish between things at the
library level and those at the build level.

" In practice, of course, those sources are
almost never pure C++; who writes out complex table
initializations, when AWK can do it from a simple text file more
easily?"

(Well I probably would, but that's an aside).

"Can you really say that you've created a serious C++
program in which none of the sources are automatically
generated?"

Remember, I'm slowly _replacing_ the standard C++ library!

"Can you really say that you don't use some sort of
source code control, and that your sources aren't necessarily
directly accessible from the compiler?"

I'm not in a team environment currently (yeah me!).

"That you don't use a
data base, or a third party windowing library, or any third
party connectivity software?"

I'm working on all of those.
Pretend it's the last compile before packaging and deployment and not
everything from concept to purchasing shrink-wrapped sofware in a retail
store. But it's not worth talking about. If you think that exotic means of
Me: Using 2 compilers in a chain is for very specialized, very
non-mainstream development scenarios.
You: No it's not.

"You're missing the point."

I don't think so, but I'll listen...

"If you use Comeau, that's the only
"compiler" you have in your chain."

Well I don't know. I've not used it. I thought it required some "hooking up"
to the platform compiler.

"Comeau, of course, may use
other tools, but then, so does g++ on my Solaris machine."

C'mon, a second HLL compiler?? It's a stretch.

"That's Comeau's problem, not mine. And of course, a "compiler"
is simply not the only tool I have in my tool chain. I use lex,
yacc, awk, etc. for code generation. I use third party
libraries for data base accesses. I do depend on multiple
suppliers."

But at different levels of the development process.

"I can't imagine any serious application which
didn't; you don't work in a vacuum, and you certainly aren't
going to redevelop everything yourself."

Well right now, I'm working alone, but no, not in a vacuum (duh, I'm here
right?).
If you like to lump everything into one category, so be it.
Class hierarchy: development tools. Not much of a hierarchy
huh. (We were talking about compilers. USUALLY there is only
one).

"I'm not sure I follow you. You seem to have created an
artificial category: compilers."

Actually you did a month or so ago when you said something like "it's pretty
well accepted that 'compiler' means 'compiler system'". I said something
about how I consider a "compiler" that thing that builds source into object
code, akin to popular vendor commandline compiler offerings. To which you
replied that the standard library is part of the "compiler". Remember?

"The tools I use to "compile"
code are drivers which invoke multiple sub-tools."

I can't go that far. I like the definition Greg put forth.

"In some
cases, all of the sub-tools come from the same supplier, but not
always: g++ under Solaris uses the Sun linker, for example."

I think I'd go as far as "compiler system" meaning: compiler+linker. (Of
course they are separate though).

[...]
It just means that you are jobbing out the difference resolution to Comeau
instead of doing it yourself. Instead of dealing with differences in C++
implementations, you're letting Comeau deal with differences in C
implementations. Of course, doing it in C is an alternative also.

"That's a more or less accurate way of describing it. Just as by
using a high level language, I'm jobbing out the differences in
machine architecture, and by using a commercial database, I'm
jobbing out the incredible amount of work which would be
necessary to write one myself. Anytime I can job work out, I
win."

Different categories noted in your passage above. I can't lump all those
things into one thing. I feel tension and pressure from "compiler" vendors
trying to lock me out of low level development. I'm simply not allowing it.
Comeau will get the code to something platform-specific but not
hardware-specific. That's why I consider it a "front end". Which begs the
question: "Why doesn't Comeau put a back end on it for each platform and
sell a "real" compiler?

"The real question is: why should they?"

Ummm, let me see... staying in business??

" They have something
which works."

It's getting a bit long in the tooth I think if you're outside of the niche.
I don't see potential for marketing outside of that niche (to me for
instance) without becoming a "real compiler" vendor. But hey, that's just
lil ol me.

"They make it available at a very reasonable cost."

VC++ is free. BC++ is free. g++ is free. (Is Watcom still viable?).

"If Greg had to write (or pay someone to write) a machine code
back-end for each platform, the compiler would cost more."

I too believe there is no market in JUST a compiler because there are so
many FREE ones. (The problem is still the language).

"Just
as I use a commercial database, rather than write my own,
because I get a lot better product a lot cheaper that way, Greg
lets the specialists in each machine architecture provide the
back-end for that architecture."

Okies. I guess another Dr. Dobb's article is in order (?).
Nah, it's bad all around (note JohnQ jumping out of the hot
oil): C++ should be implementable.

"It is. EDG has done so, and it certainly has a lot less
resources that companies like MS or Sun."

Even the way you said that is indicative: "had done it" (as if miraculously
has done so).
If it is so bad that one cannot trust that code can be
written to be compiled on any compiler, something else is VERY VERY wrong.

"Something is very, very wrong. Some suppliers have chosen to
ignore the standard, for whatever reasons, and just implement
the parts of it which interest them. Often with in house
extensions added to it."

Or it's just too complex.
1. I think the importance of standard conformance is over-blown relative
to
all development issues.

"That's probably because you've never had to develop professional
level code."

Right. :p

" What do you base your language understanding on, if
not the standard?"

Common sense and practicality and engineering judgement.

" You have a choice: standard conformance, or
vendor lock in and unportability."

Or something in between or divorced from both extremes.

[...]
I think a better approach is to know what the issues are and then code
around them.

"In theory, you're right. In practice, you have no means of
really knowing in advance what all of the issues are going to
be."

I was refering to such as Dr. Dobb's comparison of C++ compiler conformance.

"Compiler vendors don't advertise up front that they don't
actually do some things correctly."

[...]
Aside: Now may be a good opportunity to list the things (conformance
issues?) that may be of enormous concern to developers that Comeau solves
and the other guys don't. What would be interesting also is a comparison
of
where compilers are at today to where they were yesterday, against the Dr.
Dobb's article someone refernced earlier perhaps. I have a feeling that
I'll
find the issues mostly remote/non-important.

"You, maybe. You've already mentionned that you don't like or
use templates. If you don't like or use templates, then many of
the issues do disappear."

That's good to know. :) I've seen you lately too note that some shops
restrict use of templates and seem to be accepting of such. Yet wasn't I a
big thorn saying such blasphemous stuff a few months ago.

" As it happens, I'd like to use
templates, but most companies still forbid them at the
application level, because of portability problems. There are
things in Boost I'd like to use, but some companies still forbid
even the standard library, because of portability concerns (and
in fact, we've had problems recently when porting code from Sun
CC to g++, and vice versa)."

Oh, even the standard library huh. See, I didn't know that there was anyone
out there agreeing with me on that.

"Use Comeau and the Dinkumware libraries everywhere, and this set
of problems disappear. (Use C90, and they disappear as well.
Interestingly enough, use C99, and you run into exactly the same
sort of problems. Which sort of proves that the problem isn't
with the complexity of the language per se, but with the
decision of compiler vendors to more or less ignore the
standard, at least in part, and with compiler users to accept
this without complaint.)"

No, I don't think that proves that C++ isn't too complex.
Again, that's a (THE) problem with C++.

"And C. And Fortran. In the past, it was always a serious
problem with Cobol---today, the only people using Cobol are on
IBM mainframes, so the problem has disappeared."

I think C++ is an escalation of the problem (but I'm not a compiler
developer, so I don't really know how bad it is).
(Unless of course there are inclings
that the platforms are competing with languages with their own APIs and
therefor purposely avoid implementing certain language elements).

"In at least one case (and no, I'm not thinking of Microsoft
here), it's very clear that the vendor would prefer that all
developments use his own language,"

Reference to Sun noted. Free Solaris looked cool until it became just a Java
delivery vehicle.

" rather than C++. More
generally, it is a question of allocation of resources, and it
would seem that most vendors, today, are more concerned with
somehow "locking you in", or at least supplying special platform
specific features, than being standard conformant. So that's
where they put their resources."

As if "C++" was not attempting to do the same.
Now that IS a valid potential use, if one decides that "the
more compilers we run the code through the better". But again,
it's a fundamental language problem IMO.

"A problem shared by most languages today, it would seem. (Ask
about support for C99 in comp.lang.c, for example.)"

The thing is though, the C guys (whoever they are) may be able to execute an
object paradigm that would give the C++ folks shudders.

John
 
J

JohnQ

LR said:
JohnQ wrote:



I'm not sure I understand that.

"(The intermediate form being symbol tables and such)."

What makes you think that the intermediate form would include symbol
tables? For what reason? And what does "and such" include?

Well I was trying to narrow down what I meant. Whatever kind of constructs
the source code is parsed into, that's what I was considering "intermediate
form". "The place from which anything can be generated". "Symbol tables" was
just a traditional construct I tried to use to give an idea of what I
consider as "intermediate form".
I always thought that the intermediate form would be code of some kind.

Not me. No way. That's code generation. That comes after syntax checking and
semantic analysis and "putting into proprietary constructs". When source
code turns into those traditional programming constructs (say STL containers
and algos), THAT is intermediate form. (Or PRIMARY intermediate form).
In the case of Comeau's compiler, C code.

Nope. That comes after. That's "code generation". Sure, it's "intermediate",
but auxiliary.
Not to say that a symbol table wouldn't be useful for, say, a cross
reference tool or something, but I don't see why it would be included in
the intermediate form.

I think it pretty much IS the intermediate form.
But perhaps I'm wrong. What do you think the intermediate form is?

I tried to explain more above.

John
 
L

LR

JohnQ said:
Well I was trying to narrow down what I meant. Whatever kind of
constructs the source code is parsed into, that's what I was considering
"intermediate form". "The place from which anything can be generated".
"Symbol tables" was just a traditional construct I tried to use to give
an idea of what I consider as "intermediate form".


Not me. No way. That's code generation. That comes after syntax checking
and semantic analysis and "putting into proprietary constructs". When
source code turns into those traditional programming constructs (say STL
containers and algos), THAT is intermediate form. (Or PRIMARY
intermediate form).


Nope. That comes after. That's "code generation". Sure, it's
"intermediate", but auxiliary.

A different usage of the word intermediate then? I suppose I lost that
context. My bad.
I think it pretty much IS the intermediate form.


I tried to explain more above.


Ok. I understand what you meant now, and so even though it wasn't
directed to me, the question you asked:

"So, would you consider going from source code to an intermediate form,
doing semantic analysis and such along the way, compiling? (The
intermediate form being symbol tables and such)."

May be answered in a word: No.

But I would consider going from C++ to C code that can be compiled by a
C compiler compiling. Just as I'd consider going from C++ to assembler
compiling. Or going from C++ to either executable or linkable machine
code (what is often called object code) compiling.

But the creation of symbol tables "and such", while it might be part of
a compiler, is not in and of itself compiling.

Wikipedia, http://en.wikipedia.org/wiki/Compiler, gives this definition:
"A compiler is a computer program (or set of programs) that translates
text written in a computer language (the source language) into another
computer language (the target language)."

And so I think my understanding fits.

I really do like that parenthetical comment "(or set of programs)". So
I suppose taking C++ through Comeau's compiler to C, and taking the
produced C to assembler, and taking the produced assembler to machine
code, may in total be considered to be compiling by wikipedia's
definition. And by the definition each of the steps may be considered
to be compiling too. I like that. It's like triangles. Each one can
be made up of other triangles.

Although, of course, it's pretty easy to find definitions that differ.
This one for example from
http://foldoc.org/index.cgi?query=compiler&action=Search

"A program that converts another program from some source language (or
programming language) to machine language (object code). Some compilers
output assembly language which is then converted to machine language by
a separate assembler."

But IMO the second sentence dilutes the strict meaning of the first.
Tsk, tsk, that's two tools in the chain.

But frankly, I suspect it's all besides the point.

I don't use it myself, except the online try it out function, but I'd
guess that plenty of people find Comeau's compiler to be a useful tool.
If I was in other circumstances, I think I'd find it useful too. But I
think you don't imagine yourself to be in this group.


LR
 

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
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top