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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucsd!helios.ee.lbl.gov!hellgate.utah.edu!cc.utah.edu!rcapener From: RCAPENER@cc.utah.edu Newsgroups: comp.lang.ada Subject: Re: Sizes of executables from VMS (was UNIX) Compilers Message-ID: <68773@cc.utah.edu> Date: 10 Jun 90 06:46:16 GMT References: <1930@sparko.gwu.edu> <1990Jun8.213230.10693@cbnewsl.att.com> X-Local-Date: 9 Jun 90 23:46:16 PDT List-Id: In article <1990Jun8.213230.10693@cbnewsl.att.com>, arny@cbnewsl.att.com (arny.b.engelson) writes: [ Hello World code and other stuff deleted ] > I can't believe I'm doing this. I got curious enough to go run these on > a VAX/VMS system using DEC's Ada and C compilers. Given the results, I > decided to post them (and start a war I'm sure, but what the hell)... > > First of all, I ran the compilers with their default settings, no special > optimizations, pragmas, options, nothing. Second, the source looks exactly > like Mike's programs above. Last, the results: > > Ada executable = 6 blocks (512 byte blocks) > C executable = 87 blocks " > I can't either, since I assume you already know that Ada (and almost all other languages on VAX-VMS) link in the shared libraries by default, while C does not. To do that you need a file (name it SHARE.OPT) in your SYS$LOGIN directory that has the following line in it: sys$share:vaxcrtl/share then you link your files as follows: link file1,file2,file3,sys$login:share.opt/opt You can also create a simple clink.com file for handling one *.obj file that was created from one C source file. Put it in your SYS$LOGIN dir. It is as follows: $ if "''p1'" .nes. "" then goto$ setlinkfile $ if "''shlinkprevfile'" .eqs. "" then goto$ getfile $ $goto dolink $ getfile: $ inquire p1 "enter filename" $ setlinkfile: $ shlinkprevfile == "''p1'" $ dolink: $ link 'shlinkprevfile',sys$login:share.opt/opt $ assign/user sys$command sys$input $ exit You also need the following line in your LOGIN.COM file: $ clink :== @sys$login:clink You will notice that now that the C code is linked with the shareable libraries, it shrinks drastically in size, and is usually smaller than the equivalent Ada *.exe file. This blurb was provided for the enlightenment for those in the Ada community that work strictly on UNIX and DOS machines. If you link the non-shared libraries with C (the default), and link the shared libraries with Ada (also the default) on VAX-VMS, you are comparing apples with oranges. Link the C generated code shared, and we have a fairer apples - apples comparison. I am sure Arny knew this, and produced it solely for the entertainment of the VAX-VMS community. Happy times with Ada (pun intended)