comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Compiler for Z80/6510
Date: 1999/11/26
Date: 1999-11-26T00:00:00+00:00	[thread overview]
Message-ID: <81m4m4$ci0$1@nnrp1.deja.com> (raw)
In-Reply-To: 383DC86C.19A6F176@australia.boeing.com

In article <383DC86C.19A6F176@australia.boeing.com>,
  Peter Milliken <peter.milliken@australia.boeing.com> wrote:
> G'Day Robert,
> I am curious, on the one hand we have this paper (advertised
in the Ada
> Home page) and on the other hand, experienced compiler writers
such as
> yourself.

People have often made claims that compilers do much better
than the best assembly language. First of all this is on its
face absurd, since the compilers are only generating assembly
language in any case.

So it must be a case about competence of the assembly language
programmers.

Since competence of assembler language programmers can easily
vary over two orders of magnitude, it is not surprising that
different people come to different conclusions.

In practice, really skilled assembly language programmers (there
are very few around, especially these days), can always outrun
any compiler given enough time and effort.

That does not mean the paper is invalid, it just means that it
should always remind people that it is talking about typical
assembly language programmers.

I once wrote an Ada 83 parser in x86 assembler to demonstrate
what can be achieved. This is a full parser for the official
syntax of Ada 83, and of course includes a lexical analyzer.
It finds the first error, and then quits, giving a reasonably
informative error message.

DASC is 14K bytes long, but this is deceptive, since over half
this space is text for error messages.

I had not run it for a while on a modern PC, but I just ran
it on a file with 6 million lines of Ada source (the file
size was just under 100 megabytes).

It took about 7 seconds to parse the 6 million lines of source
on a PC, giving a speed of approximately 50 million lines a
minute (this is mostly I/O time in fact).

Now this is VERY aggressive code, but I can pretty much promise
you that no Ada compiler comes close or is likely to in the
future. A student of Paul Hilfinger's analyzed this code to
understand where it's speed advantages came from, and concluded
that some, but not all of them, could be achieved with entirely
new optimization techniques. He wrote an interesting paper
called "Galactic Optimization" but I think it was never
published.

Briefly what happens in very aggressive assembly coding is that
you plan the high level data structures and algorithms of the
program knowing exactly what is and is no efficient on the
underlying machine.

Now of course NO ONE is advocating that ordinary coding be
done at this level, and further more, the number of people
who could duplicate DASC even in assembly language is very
small [in earlier days, I probably wrote a million lines of
delivered commercial assembly language for various machines
and I got quite good at it :-)]

Robert Dewar

P.S. I definitely think that compiler writers need to be aware
of how to write efficient assembly language, and surprisingly,
this is not always the case!


Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~1999-11-26  0:00 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-24  0:00 Compiler for Z80/6510 Lutz Donnerhacke
1999-11-24  0:00 ` Wil
1999-11-25  0:00   ` Lutz Donnerhacke
1999-11-25  0:00     ` Robert Dewar
1999-11-25  0:00       ` Peter Milliken
1999-11-26  0:00         ` Tarjei Jensen
1999-11-26  0:00         ` Ed Falis
1999-11-26  0:00           ` Robert C. Leif, Ph.D.
1999-11-27  0:00             ` Florian Weimer
     [not found]             ` <01bf38cb$be9b2b60$022a6282@dieppe>
1999-11-28  0:00               ` Robert Dewar
1999-11-28  0:00                 ` Robert A Duff
1999-11-30  0:00                 ` Pascal Obry
1999-11-28  0:00             ` Robert Dewar
1999-12-06  0:00           ` Richard D Riehle
1999-11-26  0:00         ` Robert Dewar [this message]
1999-11-26  0:00           ` Robert A Duff
1999-11-27  0:00             ` Robert Dewar
1999-12-01  0:00             ` Robert I. Eachus
1999-12-02  0:00               ` Larry Kilgallen
1999-12-02  0:00                 ` Robert I. Eachus
1999-12-03  0:00               ` Robert Dewar
1999-12-03  0:00                 ` Robert I. Eachus
1999-12-06  0:00                   ` Robert Dewar
1999-12-13  0:00                     ` Robert I. Eachus
1999-12-13  0:00                       ` carr_tom
1999-12-17  0:00                         ` Robert I. Eachus
1999-12-19  0:00                       ` Robert Dewar
1999-12-21  0:00                         ` Robert I. Eachus
1999-12-23  0:00                           ` Robert Dewar
1999-12-23  0:00                             ` Robert I. Eachus
1999-11-26  0:00       ` Vladimir Olensky
1999-11-26  0:00         ` Robert Dewar
1999-11-26  0:00           ` Vladimir Olensky
1999-11-27  0:00             ` Robert Dewar
1999-11-28  0:00               ` Vladimir Olensky
1999-11-24  0:00 ` Frank Klemm
1999-11-24  0:00   ` Lutz Donnerhacke
1999-11-24  0:00 ` Tucker Taft
1999-11-29  0:00 ` Marin Condic
1999-11-29  0:00   ` Robert C. Leif, Ph.D.
1999-11-29  0:00   ` Lutz Donnerhacke
1999-11-29  0:00     ` Marin Condic
1999-11-29  0:00       ` Lutz Donnerhacke
1999-11-29  0:00   ` Mike Silva
1999-11-29  0:00     ` Marin Condic
1999-11-29  0:00       ` John Duncan
1999-11-30  0:00         ` Lutz Donnerhacke
1999-11-29  0:00       ` Mike Silva
1999-11-30  0:00       ` Tarjei Jensen
1999-12-01  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox