comp.lang.ada
 help / color / mirror / Atom feed
From: cis.ohio-state.edu!math.ohio-state.edu!darwin.sura.net!newsserver.jvnc.ne t!louie!balin.cis.udel.edu!carroll@ucbvax.Berkeley.EDU  (Mark C. Carroll)
Subject: Re: Admiral Tuttle (Should be ...) Revisited
Date: 20 Jul 93 15:46:49 GMT	[thread overview]
Message-ID: <1993Jul20.154649.27200@udel.edu> (raw)

In article <9307140635.aa13529@dsc.blm.gov> cjames@DSC.BLM.GOV (Colin James 062
1) writes:
>
>  
>The assertion that "oracorp.com" is Oracle is of course mistaken,
>and thank you all for private mail to that effect.
>
>Mark C Carroll, and others, assert that C++ is not a pre-processor
>and that C does not necessarily produce faster running code.  In
>my opinion they are misinformed because the original definition
>and intent of C++ was as a pre-processor to generate C code (not
>assembler or machine code).  If C++ has become something else then
>it should have a new name such as C+++ for non-pre-processor
>implementations on hardware platforms such as PC's.

I want to respond to two points in the above, seperately.

First of all: I think that the issue of C++ as preprocessor or
compiler is entirely independent of whether C code runs faster or
not. Regardless of how C++ is compiled, _any_ piece of C code can be
written in C++ (sometimes it will require extra casts, but the basic
code is identical), and will generate _identical_ code to C - either
because 
  (1) the compiler outputs the code in standard C, so it generates the
   same output code for the same input code; or
  (2) the compiler generates true object code, but because the operations
   being performed are identical, and the semantic information available is
   identical, equivalent object code will be produced. (If the same code 
   generator is used, as in the GNU g++ compiler, then this will result in
   identical code.)

Second: what is the difference between a compiler and a
preprocessor. You're calling C++ a preprocessor, because what it
outputs is C, rather than assembly language. I argue that that is
*not* the difference between a preprocessor and a compiler: the
difference is that a preprocessor does strict textual replacement
without regard for semantics, but a compiler does semantic analysis
and performs a translation from a source to an object based on the
semantic analysis.

By that definition, C++ is, and always was a compiler.

If you define a compiler as something that produces assembly code,
then I think you're using a definition which argues against reality:
is the DEC Scheme-to-C compiler really just a preprocessor? Is the
Sather language from Berkeley really just a preprocessor? Both take
languages fundamentally different from C as input, and generate
standard C as a generic intermediate language, and then use the system
C compiler as a back end. C++ is just like those two, except that the
source is much closer to the intermediate language.

	<MC>

-- 
|| Mark Craig Carroll: <MC>     ||"Don't try to tell me there's no reason
|| CIS Grad, Univ of Delaware   || for any moment in time, for every memory
|| PGP key available by finger  || of mine. Those years are lines of color on
|| carroll@udel.edu             || my face, the past is warpaint"-Happy Rhodes

             reply	other threads:[~1993-07-20 15:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-07-20 15:46 cis.ohio-state.edu!math.ohio-state.edu!darwin.sura.net!newsserver.jvnc.ne [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-07-21 20:23 Admiral Tuttle (Should be ...) Revisited Larry Liang
1993-07-21 18:29 cis.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!noc.near.ne
1993-07-21  2:08 Alex Blakemore
1993-07-21  1:23 usenet.coe.montana.edu!netnews.nwnet.net!news.u.washington.edu!stein2.u.w
1993-07-20 14:29 Gregory Aharonian
1993-07-20 11:29 pipex!bnr.co.uk!uknet!mcsun!sunic!news.lth.se!dag
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox