Path: utzoo!attcan!uunet!cs.utexas.edu!samsung!ernie.viewlogic.com!m2c!umvlsi!dime!smectos!eli From: eli@smectos.gang.umass.edu (Eli Brandt) Newsgroups: comp.lang.pascal Subject: Re: EXE file size, C vs. Pascal Keywords: C, Pascal, MsDos Message-ID: <22599@dime.cs.umass.edu> Date: 14 Nov 90 20:38:28 GMT References: <16398@mentor.cc.purdue.edu> Sender: news@dime.cs.umass.edu Reply-To: eli@smectos.CS.UMASS.EDU (Eli Brandt) Organization: University of Massachusetts, Amherst Lines: 39 In article <16398@mentor.cc.purdue.edu> nuspljj@mentor.cc.purdue.edu (Joseph J. Nuspl Jr.) writes: > >Over the past year, I have written several Unix-like commands -- cat, ls, ... >in Turbo Pascal 5.5. I have recently rewritten them in Turbo C++ hoping >to improve speed and/or reduce file size. The C compiled programs are >significanly larger. Cat in Pascal is ~3k, Turbo C ~17, DeSmet C ~10. > >I will continue my 'Ms-Dix' project and was wondering which platform, C or >Pascal, that I should continue with. I am trying to keep the size of the >executables small and have the speed of execution as fast as possible. > >BTW - I don't have time to code every thing in Assembler. > >Comments? Two, neither of them very encouraging. First, there are already a *lot* of unix-utility-for-DOS packages, PD ones. Second, something like ls should most likely be written in assembly. Re your .exe-sizes, I'm really not sure why people expect C to produce tighter code than Pascal. Presumably a holdover from massive mainframes, where the C compiler was just *so* much better than the COBOL compiler... however, Borland did a nice job on both TP and TC, so there isn't much difference. And printf is bigger than writeln, which probably account for much of your size difference. Does any renegade Borland-type know whether Borland uses the same backend for all of its compilers? > >Thanks. > > /_/| /_________/| /________/| Joseph J. Nuspl Jr. [sig clipped somewhat] Disclaimer: UMASS doesn't even know I'm here. Note that I said "unix" of there, which is fine because the real Un*x is case-sensitive. :-/ Eli