Journal Articles
Browse in : |
All
> Journals
> CVu
> 133
(12)
|
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. 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/yourtheme/modules/articles . The templates will get the extension .xt there.
Title: The Etymology of Comeau C/C++
Author: Administrator
Date: 03 June 2001 13:15:46 +01:00 or Sun, 03 June 2001 13:15:46 +01:00
Summary:
Body:
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.
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.
But how and why did Comeau C/C++ come about in the first place? Already having a few compilers "under my belt", 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.
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 "hug the hardware" but I really wanted to "aid the algorithm" 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.
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&T as the first version of Comeau C/C++. And that took on a life of its own. Eventually I ported it "everywhere" and the rest as they say is history ( www.comeaucomputing .com/faqs/genfaq.html#history for some details).
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&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:
-
Stability (certainly fundamental language features should be available, and furthermore they should work properly)
-
Robustness (software shouldn't crush under its own weight, and Comeau C/C++ shouldn't either)
-
Being up to date (that is, trying to be compliant with Standard C++, http://www.comeaucomputing.com/features.html contains our latest features list)
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.
The audience for Comeau C/C++ is varied, and across a few levels. It tends to span three areas though:
-
Those wanting to use the "generally available" ports of Comeau C/C++ (Solaris, Windows, LINUX, etc.)
-
Those wanting a custom port of Comeau C/C++ (new platforms, cross compiling, embedded systems, etc.)
-
Those wanting to use our online compiler (web compiling, reference, etc.)
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:
-
A standard conforming compiler
-
Transparent multi-platform capability
-
Source code compatibility without the necessity for work-around's
-
A "backup" compiler (good error diagnostics, etc.)
-
A reference implementation
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.
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.
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.
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.
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 "hunt and peck" 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.
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.
An aspect of Comeau C/C++ which is confusing to many people is that it can generate C as its object code.
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.
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.
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.
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.
The problem is that as C++ and C are closely related, it is incorrectly concluded that the Comeau compiler either "does nothing" or is "just a preprocessor". 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.
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 "C generating back end" 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.
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.
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.
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 Inside The C++ Object Model describes something very similar to Comeau C++. There is also a FAQ on C++ to C translation in Marshall Cline's well known "C++ FAQ".
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 "count down to export" on our main website which we'll keep revising to reflect the expected ETA for export in Comeau C++).
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.
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 <greg@comeaucomputing.com>.
Notes:
More fields may be available via dynamicdata ..