Re: Folk Theorem: Assemblers are superior to Compilers

Mohd Hanafiah Abdullah <napi@cs.indiana.edu>
Tue, 26 Oct 1993 21:48:13 GMT

          From comp.compilers

Related articles
Folk Theorem: Assemblers are superior to Compilers elliottm@csulb.edu (1993-10-24)
Re: Folk Theorem: Assemblers are superior to Compilers dmartin@andy.bgsu.edu (1993-10-26)
Re: Folk Theorem: Assemblers are superior to Compilers napi@cs.indiana.edu (Mohd Hanafiah Abdullah) (1993-10-26)
Folk Theorem: Assemblers are superior to Compilers ssimmons@convex.com (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers vick@wotangate.sc.ti.com (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers leichter@thorium.rutgers.edu (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers cliffc@rice.edu (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers macrakis@osf.org (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers amn@ubik.demon.co.uk (1993-10-27)
[30 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: Mohd Hanafiah Abdullah <napi@cs.indiana.edu>
Organization: Compilers Central
Date: Tue, 26 Oct 1993 21:48:13 GMT

Mike Elliott <elliottm@csulb.edu> wrote:
> Folk Theorem 1:
> In an actual real-world application, assembly language produces
> faster code than a modern production-quality compiler in a
> decent high-level language.
>
> Folk Theorem 2:
> In an actual real-world application, assembly language produces
> more compact code than a modern production-quality compiler in a
> decent high-level language.
>...
>So . . . compiler weenies of the world . . . can you help me out with
>citations which refute (or for that matter, support) these folk theorems?


Modern optimizing compilers have been designed to be excellent in "big
catches" code improvement via global optimizations using well researched
techniques and algorithms; not to mention the myriads of local
optimization techniques like peephole optimization that is employed since
the early days of compiled languages.


A good comparison maybe a well-written chess program versus a human. The
human can do remarkably clever moves and deceptions against the opponent.
Unfortunately, these manipulations are relatively shallow and narrow in
scope, although highly intelligent. While the dumb computer can be made
to look ahead many steps accurately in picking the best move which a human
will find virtually impossible to do. Plus, powerful AI learning
algorithms that are programmed in the computer may have numerous board
configurations to choose from and improve upon, stored in its reliable and
relatively large memory.


To cite certain programming techniques that assembly language programmers
tend to overlook or find it too hard to implement cost effectively and
virtually error-free are:


o Register allocation (by graph coloring maybe)


o Data flow analysis for optimizing common-subexpressions, loop optimizations
    (eg. fast array referencing, and loop invariants), copy/constant
    propagations, dead code elimination, inter-procedural register allocation,
    and so forth. Also, constant folding and stack height reduction.


o Recursive programming style that is powerful in solving many programming
    problems. Scheme compilers can convert recursions into loops using the tail
    recursion technique.


These are huge and complex algorithms that compiler writers take months or
years to implement, in order make code faster and smaller, reliably and
quickly. I don't see how one could do the above in any assembly language
everytime he/she writes a software program.


High level languages and compilers are integral to at least the
workstation programming environment and I'm sure they are going to be
indispensable tools in software development for the new and powerful PCs
like the Power-PCs and the Pentiums.


My $0.02 worth.


Regards.


Napi
--


Post a followup to this message

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