Xref: utzoo comp.object:1666 comp.lang.c++:9231 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!mips!pacbell.com!pacbell!att!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.object,comp.lang.c++ Subject: Re: What is Objective C? Keywords: C++, Objective C Message-ID: <11233@alice.UUCP> Date: 25 Aug 90 15:01:58 GMT References: <3864@bingvaxu.cc.binghamton.edu> <4998@pegasus.ATT.COM> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 44 I would like to add one thing to Tony Hansen's remarks. Cfront is a compiler that works roughly like this: 1. Read and parse a C++ program into an internal representation. 2. Walk through the internal representation translating the parts of C++ that aren't in C into the corresponding C code. 3. Print out C source code corresponding to the internal representation. Now, (3) is a very small part of cfront -- somewhere around 5 percent of the total code. The reason it's there, of course, is that it wouldn't be very useful if all you got was internal representation! In other words, as you get it from AT&T, cfront is a C++ compiler front end coupled with a straightforward C-generating back end. Now, why do we do this? There are two reasons: 1. Our primary customers are companies that bundle cfront together with whatever other compilation technology they may be selling. If we were to generate machine code for their particular machines, they would probably want eventually to rip out our code generator and substitute theirs anyway. 2. We want to make it as easy as we can to get C++ running on a new machine. Reason (1) implies that it is possible for our customers to remove the C code generator from cfront and substitute their own machine-code generator. And indeed one of our customers has done exactly that: if you buy their C++ system for their machines, you get cfront + their code generator in a package that only generates machine language. I don't think it's even possible to get C out. Other companies have done similar things. For example, there's one other that instead of generating C in ASCII form, generates it as a stream of tokens that is then fed directly into the syntax analysis phase of their C compiler. Others do it the straightforward way -- just generate C and be done with it. -- --Andrew Koenig ark@europa.att.com