Re: Parallelizing (WAS: Death by pointers.)

chase@centerline.com (David Chase)
Mon, 6 Nov 1995 17:15:51 GMT

          From comp.compilers

Related articles
[5 earlier articles]
Re: Parallelizing (WAS: Death by pointers.) imp@village.org (Warner Losh) (1995-10-11)
Re: Parallelizing (WAS: Death by pointers.) Martin.Jourdan@inria.fr (1995-10-18)
Re: Parallelizing (WAS: Death by pointers.) blume@zayin.cs.princeton.edu (1995-10-23)
Re: Parallelizing (WAS: Death by pointers.) wclodius@lanl.gov (1995-10-28)
Re: Parallelizing (WAS: Death by pointers.) cliffc@ami.sps.mot.com (1995-11-03)
Re: Parallelizing (WAS: Death by pointers.) chase@centerline.com (1995-11-06)
Re: Parallelizing (WAS: Death by pointers.) chase@centerline.com (1995-11-06)
Re: Parallelizing (WAS: Death by pointers.) hbaker@netcom.com (1995-11-10)
Re: Parallelizing (WAS: Death by pointers.) dave@occl-cam.demon.co.uk (Dave Lloyd) (1995-11-13)
Re: Parallelizing (WAS: Death by pointers.) davids@ICSI.Berkeley.EDU (1995-11-14)
Re: Parallelizing (WAS: Death by pointers.) cliffc@ami.sps.mot.com (1995-11-14)
Re: Parallelizing (WAS: Death by pointers.) chase@centerline.com (1995-11-19)
Re: Parallelizing (WAS: Death by pointers.) mikey@banzai.ontek.com (1995-11-20)
| List of all articles for this month |

Newsgroups: comp.compilers
From: chase@centerline.com (David Chase)
Keywords: C++, translator
Organization: CenterLine Software
References: 95-11-015
Date: Mon, 6 Nov 1995 17:15:51 GMT

A followup to my followup, concerning why C++ would be (is) an
abominable intermediate language. I don't think my remarks were very
informative, though they do sum up my general impression about as
politely and concisely as is possible.


My experience. years ago, working with C as an intermediate language,
is that the major thing to watch out for is any feature of C more
complicated than a floating point number. Structures are ok for
internal data structures, but you have to be very careful if think
you can use one for (for instance) a representation of a data
structure from the source (non-C) language. This was confirmed,
somewhat, by the people at Xerox PARC who used C as an intermediate
language in a Cedar-to-C compiler, and had a relatively ok
experience. If you really do treat it just like a portable
assembler, you are much less likely to be disappointed.


What does this have to do with C++? Basically, there's very little
in C++ that wasn't already in C that constitutes "portable assembly
language". There's exception handling, but even there you must be
wary of the C++ semantics for EH not matching those of the source
language. (For instance, does the language you intend to implement
support asynchronously thrown exceptions? How do you plan to
implement that in C++?) It's the goofy semantic mismatches that get
you.


C is also better when you are debugging the code that you generate,
if only for the otherwise trivial reason that the names it generates
are not further mangled (since you mangled them once already in the
source-to-C transformation). Doubly-mangled names are not much fun.


This is made worse, of course, by the relatively immature state of
C++ compilers, compared to C compilers. Cfront generates really
funny-looking code, often full of what would be silly tests that
shouldn't be necessary in an intermediate-language application. The
other compiler I've looked at in great detail generally produced what
I can only call "less mature" code than the C compilers. It was ok
post-optimization, but the debuggable code was often a good deal
worse.


speaking for myself,


David Chase
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.