From: comeau@csanta.attmail.com (Greg Comeau)
Subject: Re: Is SAS C V6 C++ compatible
Originator: comeau@well.sf.ca.us
Reply-To: comeau@csanta.attmail.com (Greg Comeau)
Organization: Comeau Computing
Date: Sat, 19 Dec 1992 18:54:37 GMT

In article <DAVIDM.92Dec18180911@consilium.com> davidm@consilium.com (David S. Masterson) writes:
>Since the optimizer that a C++ to C translator is dependent on is the one in
>the C compiler, optimizations based on the C++ use of temporaries, const'ness
>of C++ objects, etc. would be impossible (correct?).

Incorrect.

>  Therefore, a C++ to C
>translator would not produce as efficient code as a native C++ compiler

We're looking at a mixed bag issue here.  In theory, a native code
producing C++ is supposed to generate better code.  In reality, that
isn't true, nor will it probably ever be.  Furthermore, upon second
glance, the in theory stuff tends to weaken somewhat because there are
ways to support the generated C code.  Further, furthermore, we're talking
about single digit percentage point difference here in the theoretical cases
where it is supposed to matter.  And given that the is *at least* historically
the spread of difference I've seen in benchmarks of compilers of various
languages over the years anyway, even if the comment was overwhlemingly
as you mention, that may not be the way that it literally will end up.

There is a plethora of optimizations that C++ compiler (native or translating)
can perform right now and aren't and those will make at least as much
(lots more IMO) difference that the compilation approach.

Just to demonstrate some of this: earlier this year we received a review
of Comeau C++ 3.0 With Templates while it was still in beta in 
Open Systems Today! magazine.  Not only was the reviewer surprised that
Comeau C++ was able to compiler faster than some of the native code compilers,
but that the object code generated by Comeau C++ was not slower (in fact I
think we were faster and smaller in some tests).  And to make this even
more meaningful, the reviewer had the nerve ;-) to turn on the optimizer
switched for the native compilers, but explicitly did not do so for the
back end C compiler (Sun C as this was reviewed on the SPARC) that was
accepting Comeau C++'s output "C object code".

> (or so
>Steve Clamage of Taumetric Corp. and vice-chairman of the C++ standardization
>committee claims).  I'm not a compiler writer, so I certainly can't back up
>this statement.

So long as this is on the table:
* Steve just recently resigned.
* I am a compiler writer.
* I am a voting and attending member of X3J16, the ANSI C++ committee
* As radiated above, I don't necessarily dispute Steve's claims, but in
  a way, the proof is in the pudding as well as in the textbook.

>I'll be happy if the implementation of C++ matches the draft standard that is
>being worked on.

Minus exception handling, Comeau C++ 3.0 With Templates matches it quite well.
And where it failed, or where things have changed since our last release,
we are currently in progress of releasing Comeau C++ 3.0.1 on all the
platforms we support.  Further, we are going to try and shoot for a 3.0.2
during 1Q93.

>I think C++ could be a good language for the Amiga provided
>the implementation is a good one.

Our customers seem to feel that way.  The main thing missing right now is
an Amiga class library.  That has a somewhat long history to it, but when we
initially released Comeau C++ for the Amiga two years ago, we started to do 
said but it seemed others would do it.  They didn't and then we resumed.
At that time however, two 3rd parties well convinced that they had the talent
and would indeed amply release their stuff.  As it is now days away from
1993 I am sorry to see that apparently this is not the case.  As such,
we have finally re-scheduled this for our 1993 to-do list.  We would still
be more than happy for a 3rd party to do this, however I am afraid that if
we were to know of it, I would pretty much demand that they go public with
that information.

>What is most needed in the implementation
>of C++ (on any system) is the exception handling capability.  Until compiler
>writers start putting out C++ with that capability, the market for vendors of
>reusable components will be hampered as exception handling *will* completely
>change the style in which objects are developed.

Maybe.  This does not mean that the feature should not be made available
though.

- Greg
-- 
         Comeau Computing, 91-34 120th Street, Richmond Hill, NY, 11418
                   Producers of Comeau C++ 3.0 With Templates
          Here:attmail.com!csanta!comeau / BIX:comeau / CIS:72331,3421
	    Voice:718-945-0009 / Fax:718-441-2310 / Prodigy: tshp50a