c++ vs ada results

Jim Showalter jls at netcom.COM
Fri Jun 14 10:11:14 AEST 1991


>Jim,
>  Could you specify one or more machines that have an available ADA compiler
>that generates code that is as efficient as a C compiler for the same machine?

Sure, but we have to qualify the answer somewhat in order for it to be
meaningful. Since C has no inherent support for multi-thread execution,
there is no valid way to compare the efficiency of Ada tasking to that
of C, since only Ada has it. So tasking is out. Since C has no inherent
support for genericity, there is no valid way to compare the efficiency
of Ada generic code to that of C, since only Ada has it. So generics are
out. Similar arguments can be advanced for fixed point types, exceptions,
and numerous other features present in Ada and missing from C. I suppose
one could try to mimic the missing features in C, thereby greatly 
increasing the size of the resulting C executable (e.g. homebrew semaphores
for rudimentary tasking, macro expansion for generics, etc), but then
we're arguing over the efficiency of the workaround in C, not the speed
of the compilers directly.

In fact, it seems to me that the only realistic comparison one can make
is between Ada that doesn't use any of the features missing from C, which
leaves us pretty much with scalar, floating point, array, and record
manipulation by subprograms/functions. And, to make the comparison even
closer, we must remember to disable all constraint checking by the Ada
compiler, since C sees nothing wrong with pointers walking off into 
hyperspace with the result that the machine tries to execute data...

Subject to all of these caveats, it is really pretty easy to find an
Ada compiler that rivals a C compiler on many targets, since there isn't
really much that the Ada compiler needs to DO. I suggest you investigate
the compilers available from Rational, DEC, Alsys, Telesoft, Tartan, and
Softech for starters.
-- 
*** LIMITLESS SOFTWARE, Inc: Jim Showalter, jls at netcom.com, (408) 243-0630 ****
*Proven solutions to software problems. Consulting and training on all aspects*
*of software development. Management/process/methodology. Architecture/design/*
*reuse. Quality/productivity. Risk reduction. EFFECTIVE OO usage. Ada/C++.    *



More information about the Comp.sys.sgi mailing list