From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,9adfbb907494972e X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,9adfbb907494972e X-Google-Attributes: gid103376,public From: "Tim Behrendsen" Subject: Re: Ada to C/C++ translator needed Date: 1996/09/29 Message-ID: <01bbae25$67c669a0$32ee6fcf@timhome2>#1/1 X-Deja-AN: 186055467 references: <32499FA0.4B5E@magic.fr> <52e5t5$m28@btmpjg.god.bel.alcatel.be> <52feul$os2@goanna.cs.rmit.edu.au> <01bbad6e$67743f20$32ee6fcf@timhome2> <52ltk5$qlf@news1.halcyon.com> content-type: text/plain; charset=ISO-8859-1 organization: A-SIS mime-version: 1.0 newsgroups: comp.lang.c,comp.lang.ada Date: 1996-09-29T00:00:00+00:00 List-Id: Ken Pizzini wrote in article <52ltk5$qlf@news1.halcyon.com>... > In article <01bbad6e$67743f20$32ee6fcf@timhome2>, > Tim Behrendsen wrote: > >Richard A. O'Keefe wrote in article > >>[snip numerical program test UltraSparc; cc: 30s, gnat: 27s,] > >>[stalin 26s (Scheme), f77: 25s] > >> > >> I can't think of any reason to convert the Ada code to C, > >> especially as the Ada compiler that got this result is free > >> and supports the Ada 95 *standard* interface with C, so that calling > >> existing C code from Ada is a breeze. > > > >I hope you're not suggesting that comparing compilers on one > >system with one program tells you *anything* about the relative > >merits of languages ... > > What I read in his results is that the quality of a compiler is > more important to performance than the language. Ignoring > the cc result the value "26 +/- 1 seconds" sounds pretty even. > It would be interesting (to me, not this group) to know how > gcc 2.7.2 would do on the C version of the program, since it > shares the same back-end as gnat, and is the C compiler used > by the stalin test. Oh, most definitely the quality of the compiler is everything (how could it not be?). The context of the thread is conversion of an Ada program to a C program, and it seems as if these numbers were meant to "prove" that Ada can be just as efficient as C, which is apparently true for this one program on this one platform. However, to generalize on that basis that Ada is *always* as efficient as C is dangerous thinking, particularly for the original poster's "real" application software that he wants to convert to C. In fact, I can show you APL lines of code that could potentially beat an equivalent C program (because there are so many fundamental primitives are are natively implemented), but that doesn't mean I want to write MS/Word using APL. And BTW, it may well be *true* that Ada can be as efficient as C. You simply can't prove it in this manner. Show me a CAD system, RDBMS, heck, id Software's Quake! written in both C and Ada (or Scheme) using the same algorithms, and *then* tell me the results. Actually, id *does* release the C source code of Wolfenstein 3D, the first real first-person texture-mapped game. It would be an amusing project to convert it to various languages and see what happens, e.g., how much time to compute a frame. -- Tim Behrendsen (tim@a-sis.com)