Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!netcomsv!jls From: jls@netcom.COM (Jim Showalter) Newsgroups: comp.sys.sgi Subject: Re: c++ vs ada results Message-ID: <1991Jun14.001114.24619@netcom.COM> Date: 14 Jun 91 00:11:14 GMT References: <1991Jun12.164741.412@news.larc.nasa.gov> <1991Jun12.201740.16463@netcom.COM> <34128@shamash.cdc.com> Organization: Netcom - Online Communication Services UNIX System {408 241-9760 guest} Lines: 36 >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@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++. *