comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: C++ bashing (was Re: Vendor bashing? Sort of.)
Date: 4 Oct 1994 14:44:15 -0400
Date: 1994-10-04T14:44:15-04:00	[thread overview]
Message-ID: <36s7pv$pqk@gnat.cs.nyu.edu> (raw)
In-Reply-To: 36rucbINN4gr@marble.summit.novell.com

Jonothan, if you reread my original post, I never said that C-Front was
not a compiler, I said that it was a preprocessor. These two classes are
certainly *not* mutually exclusive. Actually I don't even think that
compiler and interpretor are mutually exclusive.

Of these three terms, I find preprocessor to be the most precise. To me
it means precisely that you have a processor that takes one source language
and generates another which is then subsequently fed into an existing
compiler for the generated language. How much error checking the PP does
seems quite irrelevant to me (there can be compilers that do no checking
and PP's that do lots of checking). The two important charactersitics of
PP's to watch out for are end-to-end environment issues like debugging,
and inefficiencies that come from trying to map into an intermediate
language that cannot be changed (because it is defined, and the downstream
compiler cannot be modified), and might not in fact be appropriate. These
are not necessary problems, since C is set up to accomodate a preprocessor
of its own in any case, the end-to-end problems are often solved, and for
the initial version of C++ there are no serious inefficiencies that come
from the PP approach.

For either the current version of C++ (notably in the exception area), or
Ada (nested subprograms, subunits, and in particular checked arithmetic),
preprocessing into C is sure to cause significant inefficiencies since
these concepts just do not map efficiently into C. Of course one can
partially, but definitely not fully, mitigate these effects by providing
library routines.

So in short there is nothing inherently bad about the idea of preprocessing.
However, it is important to understand that, unlike C front, GNAT in no
sense generates intermediate C code. The reason that is important is that
if it did, it would have no chance of being really efficient. Since it in
fact does NOT generate C code, and since the backend of GCC can be and is 
being modified to accomodate Ada efficiently, there are no arbitrary
barriers to efficiency in GNAT (it's just a matter of time and effort 
to get rid of known sources of inefficiency).

Note that in a certain sense you could call all GCC compilers preprocessors
since they generate assembly language (a choice that is not necessarily the
most efficient in compile time, but carries no runtime penalty, and greatly
eases portability of the GCC system). However, the two possible penalties
for preprocessors are largely absent. Certainly ASM has on arbitrary
restrictions on what you can do. And in most systems, end to end issues
are well handled (although there are exceptions, GCC depends on an assembler
that can accept debugging information, and this is problematic in some
environments -- which is why, for example, there is still no GDB for OS/2).




  reply	other threads:[~1994-10-04 18:44 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-09-08 13:53 Air Force shows how meaningless Ada waiver process is Rhoda Metzger
1994-09-08 17:36 ` John R. Cobarruvias
1994-09-08 19:14 ` Greg Annoyingme gets tricky (was: Re: Air Force shows how meaningless Ada waiver process is) Ted Dennison
1994-09-08 20:16   ` John R. Cobarruvias
1994-09-13  9:46 ` Air Force shows how meaningless Ada waiver process is Richard A. O'Keefe
1994-09-13 16:14   ` Michael Feldman
1994-09-13 20:14     ` Robert Dewar
1994-09-14  2:46       ` Vendor bashing? Sort of Michael Feldman
1994-09-14 13:17         ` Mitch Gart
1994-09-15 13:28           ` Robert Dewar
1994-09-16 15:26             ` Michael Feldman
1994-09-16  1:56           ` Michael Feldman
1994-09-16 14:16             ` Gregory Aharonian
1994-09-16 18:23               ` Quo Vadis Ada Market?(was Re: Vendor bashing? Sort of.) david.c.willett
1994-09-17  0:11               ` Vendor bashing? Sort of Robert Dewar
1994-09-18 14:02                 ` Gregory Aharonian
1994-09-19 15:20                   ` david.c.willett
1994-09-19 17:11                   ` Kent Mitchell
1994-09-19 11:48                 ` Ted Dennison
1994-09-19 19:16             ` Kent Mitchell
1994-09-27  4:26               ` Michael Feldman
1994-09-27 16:38                 ` Kent Mitchell
1994-09-14 14:30         ` Mike Ryer
1994-09-15 13:30           ` Robert Dewar
1994-09-19  2:19             ` Michael Feldman
1994-09-19  3:52               ` Robert Dewar
1994-09-22 16:43                 ` Michael Feldman
1994-09-22 22:11                   ` Richard Kenner
     [not found]                   ` <35svf1$77i@cmcl2.nyu.edu>
1994-09-27  4:19                     ` Michael Feldman
1994-09-27 14:35                       ` M3 Network Objects (Formerly: bashing? Sort of.) Anthony Gargaro
1994-09-19 19:20               ` Vendor bashing? Sort of Erik Naggum
1994-09-20 13:58               ` C++ bashing (was Re: Vendor bashing? Sort of.) -mlc-+Schilling J.
1994-09-20 21:51                 ` Robert Dewar
1994-09-24 18:53                   ` Fred McCall
1994-10-04 16:03                     ` -mlc-+Schilling J.
1994-10-04 18:44                       ` Robert Dewar [this message]
1994-10-05 14:24                         ` -mlc-+Schilling J.
1994-09-14 13:49       ` Air Force shows how meaningless Ada waiver process is Christopher Costello
1994-09-17 12:40       ` Fred McCall
1994-09-22 17:15         ` Was... Air Force shows... Now... Vendor Bashing Chris Eveleigh
replies disabled

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