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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,81cf52699486abe7 X-Google-Attributes: gid103376,public From: dvdeug@x8b4e53cd. (David Starner) Subject: Re: Ada95 Strengths/Weaknesses. Date: 1999/09/28 Message-ID: <7spauv$a2g2@news.cis.okstate.edu>#1/1 X-Deja-AN: 530149569 References: <37EED7B8.245C0054@yukyonline.co.yuky> <7smp30$9aa1@news.cis.okstate.edu> <7sp8m9$a6e$1@nnrp1.deja.com> Organization: Oklahoma State University User-Agent: slrn/0.9.5.7 (UNIX) Reply-To: dstarner98@aasaa.ofe.org Newsgroups: comp.lang.ada Date: 1999-09-28T00:00:00+00:00 List-Id: In article <7sp8m9$a6e$1@nnrp1.deja.com>, Robert Dewar wrote: >In article <7smp30$9aa1@news.cis.okstate.edu>, > dstarner98@aasaa.ofe.org wrote: > >> * C compilers have a standardized interface. OTOH, you can >> distinuigsh Ada compilers by the required file names > >Are there really Ada compilers that have "required file names"? >Certainly GNAT does not have required file names. It cetianly has preferred file names, which are different from the preferred names of other compilers. >So this to me is one place that Ada clearly wins over C, rather >than loses. I guess I wasn't very clear. For most C compilers, I can say cc -o joebob joebob.c and it will work. This isn't true for Ada. There is no standaradized interface, and there's not even standard file names. >> * C & C++ compilers will usually produce smaller and faster >> code, albeit usually less than an order of magnitude. > >Well an order of magnitude would be a catastrophe, but in fact >the statement is just false. If your Ada compiler produces >junk code, get another one. In the case of GNAT, the compiler >uses exactly the same code generator as the GNU C compiler or >the G++ compiler, so for comparable source code, you get >identical object code. Check. I just recently hand converted a small game from C++ to Ada using G++ and GNAT respectively. The only changes besides that were going from 0 based indexing to 1 based, and dropping some debug code in the process. g++ *.cpp -o Alexis produces a binary with a size of 15,796 bytes. gnatmake alexis-char produces a binary with a size of 735,962 bytes. Some tweaks later (dynamic linking, no runtime checks, striping the files) produces a C++ binary of 12,568 bytes and an Ada binary of 51,124 bytes. Stripping out the random number library I had used from Mat Weber's Components (which cripples the program, but to be fair Mat Weber says it's redundant with Ada95, so I could probably remove it if I knew how) brings us down to 32,196, over twice the size of the original. So, since GNAT is junk, do you have another Ada compiler to recommend? David Starner - dstarner98@aasaa.ofe.org