    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: The Etymology of Comeau C/C++</title>
        <link>https://members.accu.org/index.php/articles/1124</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>




<div class="xar-mod-head"><span class="xar-mod-title">CVu Journal Vol 13, #3 - Jun 2001</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c77/">CVu</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c120/">133</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;The Etymology of Comeau C/C++</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 03 June 2001 13:15:46 +01:00 or Sun, 03 June 2001 13:15:46 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e20" id="d0e20"></a>Comeau C/C++
Abstract</h2>
</div>
<p>Comeau Computing is among the very first group of vendors who
brought out C++ implementations during the 1980's, yet Comeau
Computing is perhaps the only remaining of those original
companies. This article serves to provide some background
information about what has kept Comeau C/C++ going, its history,
why Comeau C/C++ was even produced in the first place, who the
Comeau target audience is, etc. Also discussed are some aspects of
our business model and our near term goals.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e25" id="d0e25"></a>Some Comeau
C/C++ History</h2>
</div>
<p>Comeau C/C++ is a multi-platform compiler targeting Standard C++
and Standard C (both C90 and C99), as well as numerous dialects of
C++ and C (pcc, cfront, embedded C++, etc.). It has traditionally
been available on many UNIX systems, but it is also available for
UNIX look-alike systems, MS-Windows and other platforms too.</p>
<p>But how and why did Comeau C/C++ come about in the first place?
Already having a few compilers &quot;under my belt&quot;, I originally began
writing Comeau C/C++ toward the end of the 1980's because I was
dissatisfied with the current state of affairs. Two things in
particular bothered me. The first was the scattered state and
quality of existing C compilers. To wit, either they did not agree
with each other, or, they were broken, in particular on some
fundamental features. I felt this unacceptable.</p>
<p>The second thing that bothered me was feeling boxed into a
corner. That is to say, I really loved (and still do) C's
capability to &quot;hug the hardware&quot; but I really wanted to &quot;aid the
algorithm&quot; as well. It was frustrating mapping my designs into code
knowing that there had to be a better way to express them. C++ was
that ticket for me. It provided a pleasant enough experience that I
felt compelled, satisfied and confident enough to bring forth a
compiler. Little did I realize I would be riding right from the
beginning, and on top, of one of software's waves of success.</p>
<p>With concerns such as the above in mind, I began writing my own
C++ compiler. Oddly though, it was through a historical timing
accident so to speak that I licensed cfront from AT&amp;T as the
first version of Comeau C/C++. And that took on a life of its own.
Eventually I ported it &quot;everywhere&quot; and the rest as they say is
history ( <a href=
"http://www.comeaucomputing%20.com/faqs/genfaq.html#history"
target="_top">www.comeaucomputing .com/faqs/genfaq.html#history</a>
for some details).</p>
<p>There became a point though, probably around 1996, that we
needed to reflect. One thing was that Sun did an amazing job at
marketing Java right from the beginning. Furthermore, cfront was no
longer being maintained by AT&amp;T in any reasonable way. This
became a confusing time at Comeau, and I needed to make some key
decisions: Should we stay with C++, and if so, how can we maintain
our product line without the setback of spending years having to
re-write it from scratch and getting it all right? Eventually all
fingers pointed to our licensing EDG's front end, which had a
cfront compatibility mode, and was able to fit our business model
of providing generally available versions of Comeau C/C++ for
common platforms as well as custom versions for proprietary chips
and such. This has provided solid technology through which Comeau
C/C++ focuses on:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Stability (certainly fundamental language features should be
available, and furthermore they should work properly)</p>
</li>
<li>
<p>Robustness (software shouldn't crush under its own weight, and
Comeau C/C++ shouldn't either)</p>
</li>
<li>
<p>Being up to date (that is, trying to be compliant with Standard
C++, <a href="http://www.comeaucomputing.com/features.html" target=
"_top">http://www.comeaucomputing.com/features.html</a> contains
our latest features list)</p>
</li>
</ul>
</div>
<p>As such, our C++ (and C) core language support is
extraordinarily strong, especially in areas such as name lookup and
templates. In some ways, our focus had been to be unfocused
(platform-wise) therefore allowing us to provide a sort of generic
but solid solution all around. Therefore, traditionally, Comeau
C/C++ has not provided some of the bells and whistles found in many
compilers, instead our motivation has been in providing a product
that gets core aspects right. For instance, Comeau C/C++ does not
come with its own IDE, though that, and other things, is expected
to change beginning this summer. That is, now that Comeau C/C++'s
support of the core language is near compliant and various library
solutions for Comeau C/C++ are within sight, I believe that it's
time for us to begin providing platform specific solutions as
well.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e56" id="d0e56"></a>Who Uses Comeau
C/C++?</h2>
</div>
<p>The audience for Comeau C/C++ is varied, and across a few
levels. It tends to span three areas though:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Those wanting to use the &quot;generally available&quot; ports of Comeau
C/C++ (Solaris, Windows, LINUX, etc.)</p>
</li>
<li>
<p>Those wanting a custom port of Comeau C/C++ (new platforms,
cross compiling, embedded systems, etc.)</p>
</li>
<li>
<p>Those wanting to use our online compiler (web compiling,
reference, etc.)</p>
</li>
</ul>
</div>
<p>Luckily our business model reflects these areas, and they
complement each other well. Furthermore, on another level, our
audience desires to protect their programming investment (in source
code, etc.). Hence, our goals are to provide:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>A standard conforming compiler</p>
</li>
<li>
<p>Transparent multi-platform capability</p>
</li>
<li>
<p>Source code compatibility without the necessity for
work-around's</p>
</li>
<li>
<p>A &quot;backup&quot; compiler (good error diagnostics, etc.)</p>
</li>
<li>
<p>A reference implementation</p>
</li>
</ul>
</div>
<p>This entails a good cross section of the C++ community, allowing
a customer base including corporations, small businesses, and
governments. Now that there is standard library support for Comeau
C/C++ on many platforms, we are beginning to see a larger student
use. Many book authors obtain Comeau C/C++ as well.</p>
<p>As you can imagine then, usage varies. For instance, many folks
like to use our online web compiler, found at
www.comeaucomputing.com /tryitout for small code snippets, or to
get a feel for the features that we support before they buy Comeau
C/C++, or often just to quickly get a better error diagnostic than
the compiler their company requires them to use. Others need Comeau
C/C++ to port their own commercial products to be available on many
platforms. Another group uses our advanced template support. There
are, of course library writers, whether third party libraries or
those for in-house use. And so on.</p>
<p>Our market niche is also a good cross section of industry
including commercial off the shelf applications, communications,
telephony, networking, factory automation, numerical programming,
embedded systems, database engines, programmer tools, operating
systems, graphics, real time data gathering, hand-held devices,
etc.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e95" id="d0e95"></a>Why Does Comeau
C/C++ Exist?</h2>
</div>
<p>A primary reason for using Comeau C/C++ is that it is available
on multiple platforms. With all these ports, only gcc rivals Comeau
C/C++ in this area. Multi platform capability is important because
it means you can bring your source code to another platform and
compile it with real expectations of the same functionality (this
deals with protecting your investment as mentioned above). Of
course, this can never be accomplished fully due to OS differences,
and other reasons. However, it's much less of an ordeal than having
to move to a different vendor completely.</p>
<p>In other words, customers tell us it is of the utmost important
to have consistency across diverse platforms and implementations.
Since Comeau C++ is especially designed with cross platform and
cross operating system capability in mind, we can provide a bridge
to that. Folks want to develop source code here and use it there,
they want to specify generic interfaces to ensure portability and
then have it actually work, they need compilers on all their target
machines without having to &quot;hunt and peck&quot; for them, they want to
be assured that what worked on their original development machine
will work on other targets with no hassles or strings attached.
Comeau C/C++ addresses those concerns.</p>
<p>Many customers also like that Comeau C/C++ is highly
configurable. Not only can you get different language modes, but
you can actively select your desired level of standard's
conformance, control warning and errors at various levels of
granularity, and turn many language features on and off. This then
lets one control what they want to use or not. As a steppingstone
to the above discussion, it can be handy for code that was
originally written with another compiler, which either does not yet
follow what Standard C++ says about a feature, or, provides some
sort of extension. For such customers, allowing them to establish
transition models at their own pace is a gem.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e104" id="d0e104"></a>How Does
Comeau C/C++ Work?</h2>
</div>
<p>An aspect of Comeau C/C++ which is confusing to many people is
that it can generate C as its object code.</p>
<p>One reason this approach is so useful is so that we can leverage
off of an existing C compiler, and its tools. There is usually no
runtime performance implications for this process, although compile
time may sometimes be slightly longer. In fact, the C compiler will
already have native object code generation, optimizations, etc.,
all there for the taking. So we do.</p>
<p>Furthermore, this allows a use of Comeau C/C++ not mentioned
above. In particular, custom ports of Comeau C/C++ are always
interesting as many folks need a C++ implementation for embedded
platforms where there is only a C compiler available. Given the
number of ports we've produced over the years, this provides a
viable, reasonably priced, and expedient service for our
customers.</p>
<p>This process of course means that we have a leg up in getting
Comeau C/C++ to market. In additional to our experience and porting
savvy, this is why we have been able to port Comeau C/C++ so
widely.</p>
<p>Notwithstanding these points, the process of compilation should
otherwise just be an implementation detail. That is, the actual
process should be uninteresting for the casual user. However,
people knowing that we can generate C often leads to lots of
mistaken conclusions about what Comeau C/C++ does or not. This is
partly due to purposely devious and misleading marketing by
competitors. It is also the result of general ignorance of details
and terminology.</p>
<p>The problem is that as C++ and C are closely related, it is
incorrectly concluded that the Comeau compiler either &quot;does
nothing&quot; or is &quot;just a preprocessor&quot;. Neither of these could be
further from the truth. You cannot write some sort of glorified
macro processor to convert C++ into C, because there is no simple
mapping from C++ into C. Therefore, it doesn't, and can't work that
way.</p>
<p>Comeau C/C++ is a full compiler. It does full C-style
preprocessing, full lexical analysis, full parsing, full semantic
analysis, full template instantiation, full error checking and all
other compiler duties. A C++ compiler must do all of this. There is
no alternative. It even does full code generation. In fact, the
output C code does not come from the input C++ (or from the input C
in the case of Comeau C) but instead it is generated from the &quot;C
generating back end&quot; of Comeau C/C++, which reads the Comeau C/C++
symbol tables, trees, and our proprietary intermediate language
code that gets generated earlier in the compilation process.</p>
<p>All compilers do this. The only difference is our code
generating back end, which is able to generate C. As you can see,
none of this is preprocessing. In fact, the intermediate code is
completely able to be used to generate native object code, although
we normally do not sell Comeau C/C++ in this manner.</p>
<p>What's normally important is not such trivia, but in a compiler
getting the semantics of your program correct. The code generation
phase is but just one of many complex aspects of doing that.</p>
<p>There are other aspects to this process, but space does not lend
itself to elaborating upon all of them. On a related note, Stan
Lippman's <i class="citetitle">Inside The C++ Object Model</i>
describes something very similar to Comeau C++. There is also a FAQ
on C++ to C translation in Marshall Cline's well known &quot;C++
FAQ&quot;.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e130" id="d0e130"></a>The Future Of
Comeau C/C++</h2>
</div>
<p>Comeau C/C++ already incorporates many of the defect reports
found by the ISO/ANSI C++ Committee, and that work will continue.
We have also just released good language support for C99, and the
next upgrade should have a good handle on C99 support, possibly
including an announcement on a C99 library. Also, around the time
this article will be published we hope to have the first generally
available implementation of export (we've begun a &quot;count down to
export&quot; on our main website which we'll keep revising to reflect
the expected ETA for export in Comeau C++).</p>
<p>As well, during this summer, we plan on supporting more C
backends for our generally available ports, adding about 6 totally
new generally available platforms (HP 9000, RS/6000, DEC Alpha,
etc.) and providing support for various IDEs (MSVC++'s, Borland's
and lcc's). As usual, we will also continue providing support for
language dialects. For instance, we'll be supporting more gcc'isms
and MS'isms, etc.</p>
<p><span class="emphasis"><em>Greg Comeau is CEO of Comeau
Computing, a privately held software development, training, and
consulting firm in New York City. In addition to globe-trotting and
leading his company through the international marketplace, he can
often be found in some extracurricular activity such as
volunteering his time helping somebody out with their programming
problems. Greg can be reached at <tt class="email">&lt;<a href=
"mailto:greg@comeaucomputing.com">greg@comeaucomputing.com</a>&gt;</tt>.</em></span></p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
