Walter said:
My understanding (perhaps incorrect) is that most serious
development for procedural compilers these days is based upon
having a parser layer that produces intermediate code, with all
the optimization done at the intermediate code level. The
bulk of the work is in the optimization phases, so even if the
parsers get tuned differently, the optimization phases and
generated code grow at the same rate for all the compilers
implimented on the common platform.
Yes, but it still takes quite a bit of work to translate from the
langauge level to this intermediate level. And it takes a lot of
testing to make sure its all working correctly. And different
languages will have different emphasis on optimization.
If a language vendor is not getting feedback about C, but is about C++,
and really cannot see C as anything other than "legacy support", then
regardless of how "modularly" they could do it, what would justify them
spending effort, going forward, on the older C compiler outside of
optimizing a few benchmarks?
There could certainly be differences in the prioritization of
library implementations, or of prioritization of feature change
implementation, but the effect is somewhat different than
implied by your paragraph.
This is what I mean. Any serious compiler vendor cannot view C as
anything other than an opportunity on a few fixed benchmarks, as well
as possible bug fix requests. This is why basically no vendor is
rushing to support the "C99" standard. Of the serious vendors, only
the gcc people (who are not beholden to a market driven considerations)
even made a serious go at full support. If you read the recent
slashdot article on gcc 4.0 you will see that C performance has not
changed at all -- in fact, the majority of the effort has gone towards
better C++ support.
I am not convinced that "C as a language is clearly in decline".
Ok ... about 10 years ago, there would be no question that C was the
dominant language. The best measures I have seen regarding mindshare
of C today is at about 30% (matched equally by C++ and Java.) The
direction of these trends is obvious. Look at schools today. They
don't teach C as a fundamental language -- they teach either C++ or
Java (or C# if they've been bribed by certain entities in the Pacific
Northwest.)
It might perhaps have a lower percentage of the market than it once
did, but the market is expanding.
That's like saying Apple's market is growing, even though their
percentage is going down. (By itself,) Its not a convincing argument
for software vendors to switch to just supporting the Mac.
Most new development is not done in C, unless for some reason, that's
the only thing the programmers know. At my previous place of
employment, we started with a C project, but as we started hiring more
developers, we concluded that there was enough C++ expertise amongst
them that we simply shifted the project into C++. I mean -- knowing C
is basically a subset of knowing C++, and we started in C -- and even
*that* was not enough of an argument to stay in C.
I think whether I implemented in C or C++ would depend a fair bit
upon political factors (for stuff I'm paid to do); but when given
the choice of languages, my determination would depend on
tradeoffs between efficiency and program structure. There are an
amazing number of applications that don't *need* classes.
Well, in fact, no applications need classes. That's not the point.
Most modern developers today simply *believe* programming with classes
is better. This causes a shift in mindshare, which causes a shift in
compiler development efforts etc.
C++ as a development methodology is based upon the premise that
you will put together a library of objects and that the world will
rejoice and yeah verity the virtual classes will be fruitful
all the days of thy life. The reality is somewhat different:
yup, there are definitely some things that get implimented
over and over again that can be shared, but there is so much
application-specific logic that (according to some material I
was reading) -most- classes get used for at most 2 or 3 projects
and then get left behind. That's a lot of time spent finding
beautiful abstractions, that doesn't end up going very far...
Trust me, I'm the last person on earth who would defend C++ as a
language. That isn't the point I was trying to make.
We are in a unique situation where C++ is starting to dominate over C,
certainly compiler development is shifting in that direction (and has
been for some years now), but we have the opportunity to take advantage
of the interesting fact that C++ is an approximation of a superset of
the C language. If you make your code compilable in C or C++, then you
get to leverage the ongoing improvements of C++ compilers while not
shifting your actual language and still remaining portable to C
compilers.