octopii was . Re: [Gllug] Website developement

Nix nix at esperi.demon.co.uk
Sun Jul 15 23:28:57 UTC 2001


On Sun, 15 Jul 2001, David Freeman stated:
> they also argue that C++ should be called ++C as it was orginally a
> preprocessor for C which generated C code which you then compiled with
> CC.

Stroustrup debunks this persistent myth in _The Design and Evolution of
C++_, section 3.3.1:

`Please note that the C compiler is used as a code generator *only*. Any
 error message from the C compiler reflects an error in the C compiler or
 in Cfront, but not in the C++ source text. Every syntactic and semantic
 error is in principle caught by Cfront, the C++ compiler front-end. In
 this, C++ and its Cfront implementation differed from preprocessor-based
 languages such as Ratfor... and Objective C.'

One could state that Cfront *was* a `preprocessor' in that it processes
the source file before a C compiler. However, the code it passes to the
C compiler looks *nothing* at all like the original C++ code; it bears
as much resemblance to it as does the output of yacc to its input, and
is about as readable :) It bears the same relation to a C compiler as
the C compiler does to an assembler.

(That passage has actually been rendered incorrect by time; non-
preprocessor-based implementations of Objective C now exist. The only
one I know of is GCC's, originally implemented by NeXT and now used by
Apple for MacOS X, and maintained by Ovidiu Predescu and others.)

-- 
`I'm not sure whether libtool is an existence proof that you _can_
 write a shell script that handles its arguments correctly, or a
 demonstration that you may try but you are doomed to failure.'
                                                       -- Zack Weinberg


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list