From: lasner@watsun.cc.columbia.edu (Charles Lasner)
Newsgroups: alt.folklore.computers,comp.unix.misc
Subject: Re: The need for an assembler (was: Favorite CPU)
Date: 19 Aug 92 19:58:27 GMT
Reply-To: lasner@watsun.cc.columbia.edu (Charles Lasner)
Organization: Columbia University

In article <Bt8t2q.71H@mtholyoke.edu> jbotz@mtholyoke.edu (Jurgen Botz) writes:
>In article <bqt.714224577@Minsk> bqt@Minsk.docs.uu.se (Johnny Billquist) writes:
>>I can accept that some people doesn't like assembly language, that's ok.
>>I can also accept that hll programmers are just as adept as assembly
>>programmers. I cannot accept that a compiler would be smarter than a
>>programmer. If you put more abstractions between you and the machine,
>>you will have to accept that you get less control over what really happens.
>
>A compiler isn't going to be "smarter" than an assembly language programmer,
>but what it lacks in smarts it's going to more than make up in brainless,
>methodical, unerring dedication to the task at hand -- the task of translating
>a high-level language into a machine executable program.  I would submit to
>you that brainless, methodical, unerring dedication is what is needed for 
>that task, and in fact, that a compiler is better at it than even a very
>smart human... the human may come up with a more clever, smaller, faster
>translation, but it'll rarely be worth it, and unlike the compiler, the
>human will make mistakes.

No human would ever *want* to do what a compiler does, this is pointless.
Assembly programmers deal in an entirely different universe from a compiler.
And this is going to stay that way until an architecture is designed that's
a C interpreter directly from the source level.  Much of the housekeeping 
that the brainless compiler does is the result of the overhead in the method
it chooses to implement the abstractions in the first place.

Do you really believe that when an assembler programmer does common tasks
such as subroutine calls, etc, that they write code that housekeeps *every*
register, etc.  No, they only do what they need to do, the rest is implicit
in the design of the code, whereas compilers go out of their way to do
"cover your ass" code generation, which really is brain-less.  And yes, unlike
yourself there are people, whom I chose to call "closet" assembler programmers,
who actually *will* tweak the code outputted from a compiler to do those
very things sometimes.

>
>Now if you're going to say "write the program in assembly in the first
>place," I'd have to point you to the difference between "writing code"
>and "designing a program."  I tend to do the second, and if I do a really
>good job at it, the code almost writes itself, because there will be a
>nice, clean mappaing between the design in my head and a reasonably
>high-level language.  The rest I'll delegate to my compiler.

Bully for you.  I map nice and clean from mental design to assembler source
code to the point that sometimes I extemporaneosly type it in.  I delegate the
rest of the housekeeping to my assembler.  For me, symbolic assembly language
is a high-level-enough language.  Your method comes from an academia steeped
in telling you how to write programs using pseudo-code or other general 
methods.  And sometimes, this is acceptable.  However, I predate their
pronouncements of the "only" way to write good code.

>
>(And, btw., I've debugged enough C programms with a low-level debugger
>that generally know pretty well what kind of code my compiler is going
>to generate for any given C statement... and I still never have the
>urge to improve on it.)

Your unwillingness to improve it is besides the point.  This doesn't address
the quality of the code, just the predictability of the lack thereof.  
Moreover, the fact that you have to debug with a low-level debugger seems to
indicate that maybe some of your code doesn't flow all that well, or that what
the compiler did with it seems to be in question.  This seems to be a problem
mostly associated with C.  Still want to challenge which language has the
most problematic code written?

cjl