Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site 3comvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!sun!idi!oliveb!3comvax!mykes From: mykes@3comvax.UUCP (Mike Schwartz) Newsgroups: net.lang Subject: Re: structured assembler Message-ID: <409@3comvax.UUCP> Date: Sat, 8-Feb-86 17:18:07 EST Article-I.D.: 3comvax.409 Posted: Sat Feb 8 17:18:07 1986 Date-Received: Tue, 11-Feb-86 06:22:01 EST References: <350@3comvax.UUCP> <463@kontron.UUCP> <1078@mmintl.UUCP> <454@ho95e.UUCP> Reply-To: mykes@3comvax.UUCP (Mike Schwartz) Distribution: net Organization: 3Com Corp; Mountain View, CA Lines: 84 I agree that 'C' makes a good "prototyping" language - you might be able to formulate a program fairly quick. However, I believe that user- friendliness has become a big issue in the software world, and that a speedy program that takes less resources is much friendlier than the 'C' equivalent. People have mentioned data structures and other such things as a benefit of high level languages. Why not have an assembler with data structures? IBM has one for the IBM PC... I agree that people time is very important, but not programmer time. I don't see how it is beneficial to save a programmer a month's worth of work when the result is a program that costs the rest of the world that uses it a MUCH larger agregate time spent waiting for a slower program to load and execute (all those extra seconds multiplied by all those users of the program add up!). Laziness is what this sounds like to me. If a program is worth being used by many people, I don't see how it is any advantage to write it in 'C' (other than portability). Has anyone out there ever implemented the same program twice? I have, and I find that the second time is always much faster and much better than the first (I learn from my mistakes...) Writing a program in 'C' first, then recoding in Assembler sounds a lot better to me than just the 'C' version. A lot of UNIX gurus tell me how nice it is to have all the nice little filter programs, etc., that UNIX provides. For every 100 GREPs that a programmer does, he probably wastes a minute or two. In 1 year, how many man hours are lost throughout the country just running grep? The last point that I would like to make is about libraries. The main benefit to using a high-level language is the fancy library routines that automatically get linked in and make your programs larger. I like some of the library routines, and I have implemented many as assembler language routines. These routines are my own library, which makes my assembler coding very brisk. The other high-level features like if-then-else, etc., are simple macros to a structured assembler, so that stuff is not lost. I would like to close by giving an example of how I think most programmers can hand optimize 'C' programs, producing smaller and faster object code. The basic premise is that 99.9% of a program does not require recursion or re-entrancy. I do agree that some things are highly dependant on recursion or re-entrancy, so this will not work in those cases. #define func(a,b,c) {parm1=(a); parm2=(b); parm3=(c); func_entry(); } func_entry() { /* uses parm1, parm2, and parm3 (statics) instead of auto */ . . . } I would like to dispell a misconception about myself, too. I have been programming in 'C' for over 10 years. I used to work for a company called Systems Marketing Consolidated, from which a few guys left and made a company called "Lattice". I never used Lattice 'C' until recently on the PC, but I used the same compiler (mini-computer host, target) in '80 - I may have been the first to use it. I hope this lends a little more credability to my arguments - I have a lot of experience in both assembler and 'C' (and others), and I can see merits in both approaches. Just look at the MAC and how slow it is (ruins the friendly interface) and look at MS DOS (written in assembler), and the difference is 180K of object code (MS DOS is pretty small), and a faster environment (a vax running UNIX is slow as molasses even with 1 user). Granted the Mac was written in PASCAL. Apple shouldn't have to come out with a new faster Mac. The only reason they do is because they didn't do it right (in assembler) the first time (when they used a high-level language). Programmers should be paid to write the best programs possible (I do not believe in doing it slowly) if these programs are to become products. I still do not understand why assembler language coding is associated with slower development or less maintainability - if you have good programmers, it is not a problem. 'C' programmers actually require less knowledge of machine architecture, and therefore do not generate the most efficient programs. On the other hand, I can see that some programs are only run once (to solve some problem that would take much longer by hand), and I have no preference about what language they are written in. All I know is that the faster my assembler or compiler is, the more productive I am. This leads me to believe that it works that way for other programmers too.