Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!snorkelwacker!bloom-beacon!bu.edu!purdue!sage.cc.purdue.edu!aj0 From: aj0@sage.cc.purdue.edu (Eric Mulholland) Newsgroups: comp.sys.apple2 Subject: Re: languages (compilers and assemblers) Message-ID: <3880@sage.cc.purdue.edu> Date: 27 Mar 90 01:54:42 GMT References: <9003232001.AA00592@apple.com> <12423@smoke.BRL.MIL> <7494@latcs1.oz. <1990Mar25.210033.14719@world.std.com> <7509@latcs1.oz.au> <12435@smoke.BRL.MIL> Reply-To: aj0@sage.cc.purdue.edu (Eric Mulholland) Organization: Purdue University Lines: 39 >Article <7509@latcs1.oz.au> stephens@latcs1.oz.au (Philip J Stephens) writes: >> It seems to me that most programmers ought to be write better code than a >>compiler; ... Article <12435@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) replies: >involved, compiled code can run anywhere from somewhat faster (yes!) to >several times slower. Compilers translate statements into machine code while assembliers practicly directly convert to machine code. The only way compiled code can run faster is a sloppy programmer. A compiler is able to clean up some of the mess and thus make faster code, but with a good programmer, the compiler would have to be enormesly complex (and slow) to compete. >However, keep in mind that time spent in making non-bottleneck sections >of code run faster is time wasted. Even if you're after speed, assembler >should be used for only a small fraction of an application. Just because code is written in assembly doesn't mean long hours are spent in optimizing every routine. As mentioned before, macro libraries come into play here. Like with high level languages, they contain common routines programmers use. Something else about assembly that I feel important hasn't been mentioned. Assembly code is more compacted! The shorter the program, the more evident this becomes. See if a compiler can create the "hello world" program in about two dozen bytes! Not two dozen Ks, but bytes. One of the reasons for this comes from numbers that only need one byte often use two or four! There are a number of programs out there cross compiled to the Apple // that I feel sorry for the people who's names are listed in the credits. Grantted, not all programs written in high level languages are bad, but the ratio between bad and good is much higher than is with assembly. -- ____ Y_,_|[]| Eric Mulholland {|_|_|__| aj0@sage.cc.purdue.edu //oo--OO ...!pur-ee!sage.cc!aj0