|Re: Possible to write compiler to Java VM? firstname.lastname@example.org (W. Wesley Groleau (Wes)) (1997-01-02)|
|Re: C vs. Ada performance WStreett@shell.monmouth.com (1997-01-03)|
|Re: C vs. Ada performance email@example.com (Walter Banks) (1997-01-04)|
|Re: C vs. Ada performance firstname.lastname@example.org (Dean Sutherland) (1997-01-07)|
|Re: C vs. Ada performance email@example.com (1997-01-12)|
|From:||Walter Banks <firstname.lastname@example.org>|
|Date:||4 Jan 1997 20:51:17 -0500|
|Organization:||Byte Craft Limited|
|Keywords:||C, Ada, performance|
> [Do Ada compilers really generate better code than C compilers for similar
> source code? -John]
Wilbur Streett wrote:
> Ada compilers do more because they are farther away from abstraction
> of the hardware. That doesn't mean that the resulting code generated
> is faster, it means that the Ada code is typically written farther
> away from the hardware level in the first place.
It is a myth that only C can have close access to the underlying
hardware. Most languages can do this. What I find supprising is how
liitle C code that I see actually does that. (We write C compilers for
> I would imagine that a good C coder would consistently generate
> faster code than an Ada programmer would.
How about a "good" C programmer against a "good" Ada programmer both
with good compilers.
> There's much less chance that a C programmer would
> get very far away from the most optimized algorithms, since the
> abstraction is so close to the hardware level.
The problem in C is not the closness that a programmer is to the
target machine but the level of optimization that a compiler can apply
to a language without breaking the application intent. C's strength is
also its biggest weakness. Our compilers often interpret source code
fragments so that we can understand the programmer's intent and our
optimization limitations this time.
Good compilers will often have much better code generation algorithms
than programmers writing code. Before I get flammed this is something
compiler developers focus on as their primary task.
> Claims that Ada generates faster code seem like a straw horse to me,
> as Ada as a language reminds me so much of PL/I. Optimization by
> the compiler may be a good thing, but nothing beats code that is
> written cleanly in the first place.
No optimizer will change a bubble sort into a quick sort. In C vs Ada
we have two good high level languages. Ada is easier to optimize. C
has a lot of flexibility.
Return to the
Search the comp.compilers archives again.