Folk Theorem: Assemblers are superior to Compilers

elliottm@csulb.edu (Mike Elliott)
Sun, 24 Oct 1993 07:13:25 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)
re: Folk Theorem: Assemblers are superior to Compilers jm@tao.univ-paris8.fr (1993-10-27)
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)
[29 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: elliottm@csulb.edu (Mike Elliott)
Keywords: performance, question, comment
Organization: Cal State Long Beach
Date: Sun, 24 Oct 1993 07:13:25 GMT

I just read an unusually misinformed article in the October 2 issue of
"The Economist". In the "Science and Technology" section there appeared
an article (with no byline) entitled "When the bloat comes in", with the
following abstract:


      As software becomes more sophisticated, computers are finding
      it harder to stomach. Is there an answer to this digital
      indigestion?


This is a remarkable article on many counts, but in particular the
following paragraphs appear:


            Most modern applications software is written in
      "high-level" computer languages such as C and C++, both of
      which were developed at AT&T Bell Labs. For programmers,
      languages such as C are a dream. Fast to write and fast to
      run, they are also portable---a program written in C for a
      computer that uses the Intel chips that dominate the PC
      market can swiftly and easily be adapted to a machine based
      on any other microprocessor. High-level languages,
      however, are portly. C takes up twice as much memory the
      Assembler language in which most early applications were
      written. (Assembler is just one step from the machine
      language the computer itself uses.) And though C programs
      are fast, they are not as fleet as those written in
      Assembler.


            So why not go back to writing programs in Assembler?
      Assembler takes ten times longer to write, is prone to
      bugs, and has to be tailored to a specific processor.
      Nonetheless, to reduce the unwieldiness of their
      applications software, Microsoft and its rivals now rewrite
      between 5% and 10% of their programs back into Assembler.
      And if only "core code"---those bits of an application
      which have no contact with either a PC's operating system
      or other software---is rewritten, Assembler's lack of
      portability is not a drawback. The snag is, at best, all
      this effort cuts the size of the average application by a
      meagre 5%.


OK -- there's obviously a significant accuracy problem here that the
editorial staff of "The Economist" should address immediately, but it's
also the most recent manifestation I've seen of two folk theorems:


      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.


This is not to say that I necessarily consider C a "decent high-level
language", but I've been hearing (and raving against) this argument for at
least a decade. However, if pressed (which admittedly has never happened)
for a citation to the contrary, I would be unable to come up with anything
specific to refute either of these folk theorems.


So . . . compiler weenies of the world . . . can you help me out with
citations which refute (or for that matter, support) these folk theorems?


Thanks,
[I believe that there are compilers which can outdo human coders, but I'd
be hard-pressed to believe that any of them generate code for the 8086.
In my personal experience, rewriting C into assembler on an 8086 gets notably
smaller code because humans are better than compilers at figuring out what
to do with the very irregular '86 register set. -John]
--


Post a followup to this message

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