comp.lang.ada
 help / color / mirror / Atom feed
From: Erik Magnuson <erik@fl.ensco.com>
Subject: Re: Ada to C/C++ translator needed
Date: 1996/10/07
Date: 1996-10-07T00:00:00+00:00	[thread overview]
Message-ID: <lv684m2w8x.fsf@FL.ENSCO.COM> (raw)
In-Reply-To: 52cdn6$iis@dfw.dfw.net


dewar@schonberg.cs.nyu.edu (Robert Dewar) writes:

> 
> Frank said
> 
> "Awhile back there was a big discussion about the merits of writing an
> 8051 Ada compiler. I'm a bit surprised nobody mentioned this
> possibility, since 8051 C compilers already exist."
> 
> If you think that the existence of an Ada 83 compiler that generates C 
> means that there is an easy path to an acceptably efficient Ada compiler
> on any machine with a C compiler, you are seriously fooling yourself for
> all sorts of reasons. Nothing is as straightforward as one might hope!
> 

In a former life, I used to use such a beast daily and quickly came to
realize just why this is not a favored path to what we would call a
"production quality compiler". (No offense to the vendor intended, it was
impressive that it worked as well as it did.)

Realize that if you want to get decent performance even writing low-level C
these days you have to enable the C compiler's optimizer. You can imagine
what contortions the code generator has to go through to make sure the C
optimizer does not hose the Ada semantics.  Not to mention to workaround the
bugs in said optimizer (which change in every release.)  Especially since
the C compiler vendor's test suite is very unlikely to contain such odd
code. (Imagine reporting such bugs to the C vendor: "You're doing what?!").

And think about how much fun debugging becomes. For if you have no Ada code
generator, you're not likely to have an Ada debugger!  Oh, the joy of trying
to make sense of 3 listings (the Ada source, the generated C and the
generated assembler.)  It was not pretty. Supporting nested
procedures was a particular joy to behold.  

In addition, I believe that 8051 C compilers tend to have extensions to
exploit the features of the chip. You'll want these of course. You'll have
lots of fun trying to decide how to map onto these. 

And the compilation speed will be at least twice as bad as the C
compiler. Think about it: you have at least the entire C compiler overhead
as well as your Ada compiler source -> code gen (including the Ada
compiler's highlevel optimizer.)  (For this example, imagine the C compiler
is a hasty port of a Unix compiler to VMS that does lot's unixy things that
VMS just hates, like spawning many processes that communicate via temp files
that are byte streams, etc.) 

-- 
Erik Magnuson, ENSCO	erik@fl.ensco.com
MARSS-REPL  		(407) 783-7114




  parent reply	other threads:[~1996-10-07  0:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-25  0:00 Ada to C/C++ translator needed Emmanuel Champommier
1996-09-25  0:00 ` David Weller
1996-10-02  0:00   ` B|rje Norden
1996-10-04  0:00     ` David Weller
1996-10-05  0:00     ` Robert Dewar
1996-10-05  0:00       ` Frank Manning
1996-10-06  0:00         ` Samuel Tardieu
1996-10-07  0:00           ` Richard Kenner
1996-10-07  0:00             ` Robert Dewar
1996-10-08  0:00             ` Stephen Leake
1996-10-07  0:00         ` Robert Dewar
1996-10-08  0:00           ` Frank Manning
1996-10-07  0:00   ` Erik Magnuson [this message]
1996-09-26  0:00 ` Ian Ward
1996-10-02  0:00   ` Jon S Anthony
1996-10-02  0:00   ` Jon S Anthony
     [not found]   ` <52feul$os2@goanna.cs.rmit.edu.au>
1996-09-28  0:00     ` Tim Behrendsen
1996-09-29  0:00       ` Ken Pizzini
1996-09-29  0:00         ` Tim Behrendsen
1996-09-29  0:00           ` Robert Dewar
1996-09-30  0:00             ` Tim Behrendsen
1996-09-30  0:00               ` Matthew Heaney
1996-09-30  0:00                 ` Tim Behrendsen
1996-09-30  0:00               ` William Clodius
1996-10-01  0:00               ` Richard A. O'Keefe
1996-09-30  0:00           ` Richard A. O'Keefe
1996-09-30  0:00             ` Tim Behrendsen
1996-09-30  0:00       ` Richard A. O'Keefe
1996-09-30  0:00         ` Peter Seebach
1996-10-02  0:00           ` Richard A. O'Keefe
1996-10-05  0:00             ` Lawrence Kirby
1996-09-30  0:00         ` Tim Behrendsen
1996-09-30  0:00           ` Peter Seebach
1996-09-30  0:00             ` Tim Behrendsen
1996-10-01  0:00           ` Richard A. O'Keefe
1996-10-01  0:00             ` Tim Behrendsen
1996-10-02  0:00               ` Ian Ward
1996-10-02  0:00                 ` Tim Behrendsen
1996-10-06  0:00     ` Tanmoy Bhattacharya
1996-10-06  0:00       ` Lawrence Kirby
1996-10-08  0:00         ` Peter Seebach
1996-10-07  0:00     ` Tanmoy Bhattacharya
  -- strict thread matches above, loose matches on Subject: below --
1996-10-02  0:00 Simon Johnston
1996-10-07  0:00 ` Richard Riehle
1996-10-09  0:00   ` Richard A. O'Keefe
1996-10-15  0:00     ` Tucker Taft
replies disabled

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