Re: Assembly language programming preferable to HLL ???

Colin Plumb <watmath!watnot!ccplumb>
Wed, 3 Dec 86 23:49:23 est

          From comp.compilers

Related articles
Assembly language programming preferable to HLL ??? decwrl!nsc!nsta!instable.ether!orr (Orr Michael) (1986-12-03)
Re: Assembly language programming preferable to HLL ??? watmath!watnot!ccplumb (Colin Plumb) (1986-12-03)
Re: Assembly language programming preferable to HLL ??? harvard!seismo!utah-cs!shebs (1986-12-04)
Re: Assembly language programming preferable to HLL ??? harvard!dartvax!uvm-gen!cavrak (1986-12-05)
Re: Assembly language programming preferable to HLL ??? decvax!wanginst!infinet!rhorn (1986-12-11)
| List of all articles for this month |

Newsgroups: mod.compilers
Date: Wed, 3 Dec 86 23:49:23 est
From: Colin Plumb <watmath!watnot!ccplumb>
Summary:
Expires:
References: <277@ima.UUCP>
Real-sender:
Followup-To:
Distribution:
Organization: U. of Waterloo, Ontario
Keywords:

In article <277@ima.UUCP> Orr Michael writes:
>
> Have you seen an article in "Computer Language" magazine
>of Oct. 86 about "Universal assembly language" ?


Yes, I have. I don't intend to be too hostile, but I laughed when I read it.
"Computer Language" seems to need better articles/editing.


> This article claims that it is (always/usually) better to
>use assembly language rather than HLL. (any). This is based on the
>following claims:
>
> 1. The ONLY siginificant advantage of HLL is a shorter CODING time.
> 2. Design, documentation, testing time is (almost) the same in both cases.
> 3. The assembly program will run 2-5 times faster.
> 4. So, after enough runs of the program the coding time gap will be
> swallowed. From then on, the assembly program gains non-stop.
>
> Seems to me that this does not hold water.
>
> 1. No mention of changes/maintenance issues anywhere.
> 2. I strongly question ALL of the above assumptions.
> 3. As one of the compiler writers for NS , If assembler programs,
> as a rule, ran 2 times faster than our compiler,
> I would be greatly surprised and FIX THE COMPILER !
>
> The author also suggests a "UNIVERSAL ASSEMBLER" to run on many machines.
>I think FORTH already fits the bill, & has many other advantages.
>
> Any Comments, netlanders ?


You're right, it doesn't hold water. First, for the reasons you mentioned,
and secondly because a universal assembler is essentially impossible.


The advantage assembler has over HLL's is that the programmer can use
idiosyncrasies of the architecture to the best advantage. A compiler
can do this to some degree, but it would take a mighty good optimizer
to recognize when to use the string instructions some machines provide,
even though they can provide a very worthwhile > 2x speed increase.


A universal assembly language, on the other hand, doesn't let a programmer
use *any* tricks - and doesn't provide an optimizer which *can* use them.
In short, *slow*. Of course, you could always include a whole bunch of
common (but not universal) instructions (like, say, multiply) as macros,
but then you're just chasing HLL's up the evolutionary tree. The basic
premise needs serious work.


P.S. I agree - for very tight control of the machine and good speed,
          use Forth. It produces smaller code than a lot of compiled HLLs,
          is fast enough for most purposes, and you, the programmer, know
          *exactly* what's going on inside the machine. And, of course, you
          can easily recode any critical bits into assembler.


-Colin Plumb (ccplumb@watnot.UUCP)





Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.