Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!rutgers!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hplsla!jima From: jima@hplsla.HP.COM (Jim Adcock) Newsgroups: comp.lang.c++ Subject: Re: Eiffel vs. C++, no pointers in Eiffel Message-ID: <6590143@hplsla.HP.COM> Date: 8 Jun 89 16:20:19 GMT References: <1339@novavax.UUCP> Organization: HP Lake Stevens, WA Lines: 56 > I have heard that eiffel creates hideously large executables from very > trivial programs. Does anyone have any information as to whether this is > true or not?? I found that using advantage C++ also produced large > executables...one of the reason why I am using Zortech C_++ currently. It does > not seem to have this problem (executable size seems on average to be about > 1/5 the size of advantage c++ code). > We're talking 35K here for a hello world program in advantage...something > that can't be tolerated on the PC. One source gave the comparable eiffel > program a number even much higher. For reference here's some sizes comparing various C and C++ compilers on my mid-range 680x0 Un*x based system: linked& compile executable only hello world using stdio.h -- ie a 'printf' statement cc 12920 144 CC 13056 176 gcc 17081 172 g++ 17242 172 hello world using stream.h -- ie cout << "hello world\n" CC 34232 617 g++ *** 4577 a null program: main(){} -- to test size of run-time environment cc 4240 83 CC 4372 111 gcc 6622 120 g++ 6783 120 *** I don't have a compiled stream library for g++ cc is hp-ux 6.5 C compiler CC is AT&T cfront using hp-ux 6.5 as the back end gcc is gnu-c for the 68020 g++ is gnu-c++ for the 68020 All sizes are file sizes in bytes -- code sizes are obviously somewhat smaller -- for example cc -O -S null.c generates a _main subroutine of exactly one machine instruction -- rts [return from subroutine] Some conclusions: Trivial C programs are not exactly tiny under un*x no matter what. No great difference in executable size between C and C++ under un*x. C and C++ executables for small programs [simple tools] are probably several times smaller than other OOPL exacutables due to a simpler run time environment. G++ compiles can be several times bigger than CC compiles since G++ generates code for in-line functions [while also maybe in-lining them.] Sure would be nice to have an OS with good support for shared libraries.