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/25
Date: 1999-11-25T00:00:00+00:00	[thread overview]
Message-ID: <81k67s$47l$1@nnrp1.deja.com> (raw)
In-Reply-To: slrn83ptfb.kn.lutz@taranis.iks-jena.de

In article <slrn83ptfb.kn.lutz@taranis.iks-jena.de>,
  lutz@iks-jena.de (Lutz Donnerhacke) wrote:
> The common experience is, that high level languages result in
> slow and bloated code. But this must not be true. There is no
> reason for such
> compilers despite laziness of developers (it's an expensive
> development).

Actually this is very often the result of programmers who
program in the high level language blissfully unaware of the
consequences of what they write. It is common today (though
worrisome to me) that people write in a language like Ada
without even knowing machine code at all, let alone having
a good idea of the relation of the source they write to the
machine code being compiled for their particular machine.

Certainly if you write Ada carefully using GNAT, you will get
perfectly efficient code, suitable for use on small micro
controllers if you do a GNAT port for such a device (perfectly
practical for those microcontrollers with existing gcc ports).


> For most modern processors hand written assembler will be
> slower than a
> compiler output. The complexity of scheduling and computation
dependencies
> can be handled by a human in hundreds of hours, but a compiler
can do this
> in a few seconds in respect to all possible optimization
methods.

This is conventional wisdom, but is quite wrong. An experienced
assembly language programmer can still do better than any
compiler. It is hard work, but in fact on machines that are
the HARDEST to program by hand, e.g. the Intel i860, it is
still the case that BLAS for standard matrix operations
is far more efficient than any compiler generated code.

True, most people cannot write efficient assembler language,
for any machine. And what you say is of course true for them,
but the idea that wonderful modern compilers can generate
amazing code better than skilled humans can is just plain wrong.

> You might produce a better code for a small time critical loop
> but not overall.

Well that depends on how much time and effort you spend! And
of course small time critical loops are the only place where
code quality matters for time.

Now on micrcontrollers you are typically worried about space,
and that of course is much worse, since the entire application
has to be coded aggressively.

I once wrote a full symbolic two pass assembler for a machine
with advanced features like expression parsing and literal pool
managaement for a 4K byte machine.

THe entire assembler could assemble itself in the 4K bytes,
which had to hold the entire code for the assembler (no overlays
possible, no external disks), and the entire symbol table for
the assembly (those were the days :-). The symbol table by the
way contained about 600 symbols for this particular case.


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




  reply	other threads:[~1999-11-25  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 ` Tucker Taft
1999-11-24  0:00 ` Frank Klemm
1999-11-24  0:00   ` Lutz Donnerhacke
1999-11-24  0:00 ` Wil
1999-11-25  0:00   ` Lutz Donnerhacke
1999-11-25  0:00     ` Robert Dewar [this message]
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
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-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       ` Mike Silva
1999-11-29  0:00       ` John Duncan
1999-11-30  0:00         ` Lutz Donnerhacke
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