Related articles |
---|
[5 earlier articles] |
Re: Will C++ compilers ever be better than C compilers? jeff@jeff-jackson.com (Jeff Jackson) (1998-08-03) |
Re: Will C++ compilers ever be better than C compilers? bob.morgan@digital.com (1998-08-03) |
Re: Will C++ compilers ever be better than C compilers? chase@naturalbridge.com (David Chase) (1998-08-03) |
Re: Will C++ compilers ever be better than C compilers? terryg@uswest.net (1998-08-04) |
Re: Will C++ compilers ever be better than C compilers? mayan@watson.ibm.com (1998-08-04) |
Re: Will C++ compilers ever be better than C compilers? chase@naturalbridge.com (David Chase) (1998-08-04) |
Re: Will C++ compilers ever be better than C compilers? sandy.harris@sympatico.ca (1998-08-04) |
Re: Will C++ compilers ever be better than C compilers? mrs@kithrup.com (1998-08-10) |
Re: Will C++ compilers ever be better than C compilers? mrs@kithrup.com (1998-08-10) |
Re: Will C++ compilers ever be better than C compilers? toon@moene.indiv.nluug.nl (Toon Moene) (1998-08-10) |
From: | sandy.harris@sympatico.ca (Sandy Harris) |
Newsgroups: | comp.compilers |
Date: | 4 Aug 1998 23:27:53 -0400 |
Organization: | Compilers Central |
References: | 98-08-011 98-08-023 98-08-031 |
Keywords: | C, C++, performance |
Bob Morgan <bob.morgan@digital.com> wrote:
>>You can make the argument that a C++ compiler will be more complex, ...
[SNIP]
mayan@watson.ibm.com (Mayan Moudgill) wrote: ... It would be
> interesting to see what would happen if somebody said - lets write
> _just_ a C compiler, and throw the same kinds of resources at that.
I'd like to see a C compiler with just two C++ features, // comments and
inline functions. Do the rest of C++ in a preprocessor. C++ optimisations
go in the preprocessor & aim at producing good C. C compiler has its
own optimisations.
Am I missing something, or is this a worthwhile approach?
[Good support for C++ templates and for debugging symbols probably
requires information that it would be impractical to pass through a
C compiler. Also, there's a bunch of optimizations that although
useful in principle in C are in practice mostly useful in C++, for
example, figuring out that an indirect function call through a vtbl
can be simplified to a direct call to the function. For optimizations
like that, it's probably easier to start with the direct C++ code than
to try to recognize the idiom in translated C code. Optimizing C++ is
already hard enough, don't make it harder. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.