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,cd7d510783cb3f76 X-Google-Attributes: gid103376,public From: dewar@schonberg.cs.nyu.edu (Robert Dewar) Subject: Re: Executable File Size Differences Date: 1996/09/28 Message-ID: #1/1 X-Deja-AN: 185942955 references: <52bmn5$7r0@sjx-ixn6.ix.netcom.com> <52bq9m$7gn@nr1.ottawa.istar.net> <324D6631.4F3F@ghgcorp.com> organization: New York University newsgroups: comp.lang.ada Date: 1996-09-28T00:00:00+00:00 List-Id: Stanley said "The problem is an old one: the lack of "smart linkers" which would include only the necessary code from an Ada package, and avoid linking in the unused bulk that never gets invoked. " In the case of GNAT, whether or not unused subprograms get eliminated is a funcytion of the system linkers, since standard object file formats are used. On some sysetms they will, on many they will not. In any case the situation will be the same for Ada as for C. In practice we find that the size of executables is reasonably comparable with C. I assume no one is tryingf to sell Hello World programs for the PC, so that comparison is hardly significant. With programs of reasonable size, the code sizes are comparable. The difference you see between Hello Wolrd in GNAT (about 55K bytes) and C (10K bytes) is, as I said earlier, due to the static linking in GNAT vs DLL linking in C, and also the fact that more of the standard functionality is brought in for a simple program (that's because Text_IO has a lot of capability that the corresponding C routines do not). But once you get to larger programs, that 40K bytes becomes an unimportant difference.