comp.lang.ada
 help / color / mirror / Atom feed
From: "Tim Behrendsen" <tim@a-sis.com>
Subject: Re: Ada to C/C++ translator needed
Date: 1996/09/30
Date: 1996-09-30T00:00:00+00:00	[thread overview]
Message-ID: <01bbaee1$00ee1c20$87ee6fce@timpent.a-sis.com> (raw)
In-Reply-To: 52o1ve$gra@goanna.cs.rmit.edu.au


Richard A. O'Keefe <ok@goanna.cs.rmit.edu.au> wrote in article
<52o1ve$gra@goanna.cs.rmit.edu.au>...
> "Tim Behrendsen" <tim@airshields.com> writes:
> 
> >I hope you're not suggesting that comparing compilers on one
> >system with one program tells you *anything* about the relative
> >merits of languages ...
> 
> Of course I am.  Have you no logic in you at all, man?
> Here's what it tells me:
> 
> 	not (forall X: Problem
> 	     forall S: System
> 	     forall A: Ada_Compiler
> 	     forall C: C_Compiler
> 	     runs_on(A, S) & runs_on(C, S) =>
> 	     slower(code(X, A), code(X, C))
> 	    )
> 
> If an expensive optimising C compiler (developed for a specific machine,
> with *intimate* knowledge of that machine) can't beat a free Ada compiler
> which runs on a wide range of machines, when given idiomatic code for a
> fairly straightfoward program, what would _you_ conclude?

I would conclude that for that *specific* problem, the C compiler
did a bad job of optimization.  As I frequently point out (and
I frequently get abuse for it), optimizers are very imperfect
beasts at best.

Do you doubt that if we brought the writers of the Sun compiler
and had them fix their optimizer, they couldn't make it produce
*exactly* the same code as the Ada compiler (or Fortran compiler,
for that matter)?  Of course they could.

The real question that you refuse to come to terms with is, what
is the average case over a large set of compilers over a large set
of non-trivial programs over a large set of problem types?  And
this is a very difficult question to answer.

Your suggestion that comparing compilers on one platform for
one program tells you something significant is laughable at
best.

> *Every* time I have bothered to write the same thing in Ada and C, I have
> obtained the same results on this machine.  There isn't anything about the
> SPARC that should tip the balance in favour of Ada.  Quite the reverse, in
> fact.

Sounds like it's a crappy C optimizer to me, especially considering
the wide disparity between the C results and the other languages.
*This* is a reasonable conclusion.  If you have bothered to write
other programs in C and Ada, that would indicate to me that they
were trivial algorithms, and therefore your conclusions invalid.

Look at it this way; if I implement an algorithm in two languages,
C and C++, and compare the results, they will probably be very
similiar (if not identical).  However, let's take a very large
project with two teams of people, and have 1 implement the project
using C, and one implement it using C++.

I have no formal study for this, but speaking to many people who
have gone through the process, and reading a lot about many
manager's experiences, I have heard a common theme: Projects
implemented using OOP within the C++ language have experienced
significant performance problems because of the overhead of class
structures, heavy dependance on dynamic memory allocation, and the
difficulty in designing good object classes.

This is not because of optimization; this is because of the
language and style in which projects are implemented.  Now,
this is a significant debatable question.  Comparing the output
of optimizers is completely worthless to the central question
of whether REAL WORLD projects can be implement efficiently in
a particular language or not.

-- Tim Behrendsen (tim@a-sis.com)




  reply	other threads:[~1996-09-30  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
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               ` William Clodius
1996-09-30  0:00               ` Matthew Heaney
1996-09-30  0:00                 ` Tim Behrendsen
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         ` Tim Behrendsen [this message]
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-09-30  0:00         ` Peter Seebach
1996-10-02  0:00           ` Richard A. O'Keefe
1996-10-05  0:00             ` Lawrence Kirby
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