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,63bbc3281a2f80ea X-Google-Attributes: gid103376,public From: busigin@ibm.net Subject: Re: Ada vs. C Date: 1996/08/14 Message-ID: <4usjqd$3mmo@news-s01.ny.us.ibm.net>#1/1 X-Deja-AN: 174123477 references: <3208F2BA.E34@freenet.scri.fsu.edu> <320B693F.4ACA@freenet.scri.fsu.edu> <320D2677.499F@thomsoft.com> reply-to: busigin@ibm.net newsgroups: comp.lang.ada Date: 1996-08-14T00:00:00+00:00 List-Id: In <320D2677.499F@thomsoft.com>, Dave Wood writes: >The Quelisher wrote: >> >> Robert Dewar wrote: >> > That's bogus, comparable programs in Ada and C will generate >> > executables of the same size, at least using a technology like GNAT. >> >> Ok, so let me explain where I am coming from then. Here is the source in >> both languages that does the exact same very basic thing: >> ----------------------------------------------------------------------- >> C : >> main() >> { >> printf("Hello world! \n"); >> } >> >> ----------------------------------------------------------------------- >> Ada : >> >> WITH Ada.Text_IO; USE Ada.Text_IO; >> PROCEDURE hello IS >> BEGIN >> Put_line("Hello world!"); >> END hello; >> ----------------------------------------------------------------------- >> >> When I compiled each of the above here are the file sizes that resulted: >> C ----> 24,576 >> Ada --> 253,952 >> >> I used gcc to compile the C code and gnatmake for the Ada code, both on >> unix machines. Now that's what I meant by the difference in file sizes. >> I understand though that there is a tradeoff between file size and >> functionability of a program, but let's take PC's for example. Who wants >> to run a 6 mb program written in Ada when a 2mb program written in C >> does the same thing? I'm not trying to knock Ada or anything, rather >> just making an observation. Again, just my $.02 >> > >I get the following "hello world" figures on the PC: > >Visual C++ 4.2 ---------------> 76.0 KB >ObjectAda for Windows v7.0 ----> 89.5 KB > >This compares the current VC++ release against the pre-release ObjectAda >compiler, both with debug symbols turned off and no special optimizations. > >Not much of a difference, really, especially considering that MS has >had uncounted gazillions of person-years to apply to MSVC compared to >the humble Ada vendor (ahem). > >So, I'd have to agree with Robert: if you're comparing apples and >apples, there's little fundamental reason that an Ada program must >be bigger than a C program. I don't see where this is a language >issue, as opposed to an implementation issue. > >By the way, you forgot to #include in your C snippet. :) > >-- Dave Wood >-- Product Manager, ObjectAda for Windows >-- http://www.thomsoft.com Using GNAT under OS/2, the hello program compiles to a 262,958 byte executable. When I strip the debug code, the size goes down to 53,252 bytes. When I run the LxLite utility program to compress the EXE file, the size goes down to 31,364 bytes. This file size is certainly not out of line with C/C++ compilers. Anthony Busigin NITEK Corporation