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 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: jerry@jvdsys.nextjk.stuyts.nl (Jerry van Dijk) Subject: Re: Ada vs. C Date: 1996/08/11 Message-ID: #1/1 X-Deja-AN: 173651379 references: <3208F2BA.E34@freenet.scri.fsu.edu> <320B693F.4ACA@freenet.scri.fsu.edu> organization: * JerryWare HQ * newsgroups: comp.lang.ada Date: 1996-08-11T00:00:00+00:00 List-Id: The Quelisher (kendal@freenet.scri.fsu.edu) 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. : printf("Hello world! \n"); : Put_line("Hello world!"); : When I compiled each of the above here are the file sizes that resulted: : C ----> 24,576 : Ada --> 253,952 To me this looks like comparing a C program using shared libraries to a statically linked Ada program... Besides, what do you think you are comparing here ? With only one line of executable code, the programs mainly consist of the program start-up code and runtime library. And then I would expect the GNAT executable to be somewhat larger then the C one, since the GNAT RTL contains more functionality (like tasking). If you really want to compare executable file sizes, you should use two equivalent programs, large enough to make size of the RTL insignificant compared to the code size. But, then, whats the point to it... P.S. Under DOS a GNAT hello world is about 87K, a gcc one about 57K. If I were to use a 16-bit C compiler I would expect a 6K exe size. Using an embedded systems compiler would bring that down to about 500 bytes. If that is still to big, handwritten assembler will get away with about 40 bytes.