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=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY 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: Robert Dewar Subject: Re: Ada95 Strengths/Weaknesses. Date: 1999/09/28 Message-ID: <7sr7a4$nc4$1@nnrp1.deja.com>#1/1 X-Deja-AN: 530235829 References: <37EED7B8.245C0054@yukyonline.co.yuky> <7smp30$9aa1@news.cis.okstate.edu> <7sp8m9$a6e$1@nnrp1.deja.com> <7spauv$a2g2@news.cis.okstate.edu> X-Http-Proxy: 1.0 x29.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Tue Sep 28 20:09:51 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-09-28T00:00:00+00:00 List-Id: In article <7spauv$a2g2@news.cis.okstate.edu>, dstarner98@aasaa.ofe.org wrote: > 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. Obviously an apples-vs-oranges comparison >Some tweaks later > (dynamic linking, no runtime checks, striping the files) These are not tweaks, they are major changes! produces a C++ binary > of 12,568 bytes and an Ada binary of 51,124 bytes. Comparing the minimum sizes of trivial programs is not a terribly interesting operation, since it has almost nothing to do with real programs, but in practice if you really want to do it carefully, you can get the identical Ada and C++ object files. Of course you have to use identical libraries, not just corresponding ones, because the libraries in C++ and Ada definitely do not correspond. If you really want to waste more time tweaking, you might want to try pragma No_Run_Time and eliminate the GNAT runtime. But almost certainly you are still comparing apples and oranges, and the comparison is not particularly interesting. Stripping out the random > number library I had used from Mat Weber's Components (which cripples the > program, wait a moment, I thought you said the two programs were the same. Surely the C++ program did not use Mat Weber's component? You really have to compare identical things here. For example, the requirements on the random number generator in Ada are quite ferocious, much more so than in the case of C++. You need to use identical library routines to do a size comparison like this. > 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. But almost certainly it is not comparable to the original. If you like post the two pieces of code you compared. Quite often such postings reveal huge misconceptions in what is and is not comparable between the two languages. > So, since GNAT is junk, do you have another Ada compiler to > recommend? I don't think you need a new Ada compiler, I think you need more understanding about how to do a comparison like this in a meaningful manner. Sent via Deja.com http://www.deja.com/ Before you buy.