comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <eachus@mitre.org>
Subject: Re: Code size of Ada ?
Date: 1999/10/19
Date: 1999-10-19T16:20:35+00:00	[thread overview]
Message-ID: <380C9B88.9B4E6D5A@mitre.org> (raw)
In-Reply-To: 7ue1ds$oqi$1@nnrp1.deja.com

Robert Dewar wrote:
 
> No, I was not talking about short sequences here. I have written
> many large programs in assembly in the past (probably I have
> written about half a million lines of delivered commercial
> assembly code). For an example of a fairly large program
> written in very aggressive assembly language throughout, about
> 20K SLOC, look at the 360 implemnetation of SPITBOL (note that
> is a COMPLETE, very fast SNOBOL-4 compiler which fits in about
> 80K bytes of code -- it compiles at many millions of lines
> a minute, using the TRT instruction extensively for lexical
> analysis).
> 
> But I certainly do NOT recommend this style of programming,
> an ASM program of this size, written in this manner, is barely
> maintainable, and the number of people who can work with such
> programs is minimal.
> 
> I think it is important to understand that using higher level
> languages does have a cost. The objective is to keep the cost
> at a reasonable level (many current Java implementations fail
> to meet this criterion). With current machines, we can afford
> to give up a small factor of inefficiency, but not a large
> factor :-)

    I've written programs of that size in assembler as well, although
the limiting factor used to be memory size.  In fact I go back far
enough that I
started writing in machine code.  I have a copy of the first assembler
manual (GP--Generalized Programming--for the Univac I) in my attic, and
it was a big step forward.

    My point was that programming that results in good generated code
requires knowing exactly what constitutes good machine code, and that is
a relatively rare skill these days.  My style now, when I need this
degree of efficiency is to write in a high level language and then fix
any bogus code either in the compiler optimizer, by reorganizing the
high-level code so that the compiler does find the correct idiom, or by
writing some routines in assembler.  For example, on one Ada 83 project,
writing a seventeen instruction loop in a 25 KSLOC program as a code
insert improved performance by 25%.  Or for another example, in the
random number generator I wrote, on most hardware computing U squared
mod N, for U and N integer, can be done in two instructions (excluding
moving the data into registers) even though the intermediate value is
double word size. Writing this as a code insert can speed things up
dramatically because a lot of the computational tricks used are no
longer needed.

-- 

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




  reply	other threads:[~1999-10-19  0:00 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-27  0:00 Ada95 Strengths/Weaknesses the middleman
1999-09-27  0:00 ` Marin David Condic
1999-09-27  0:00   ` Hyman Rosen
1999-09-28  0:00     ` Ed Falis
1999-09-28  0:00       ` Hyman Rosen
1999-09-28  0:00         ` Ed Falis
1999-09-28  0:00     ` Robert Dewar
1999-09-28  0:00       ` Preben Randhol
1999-09-28  0:00         ` bill
1999-09-27  0:00           ` Aidan Skinner
1999-09-28  0:00           ` Preben Randhol
1999-09-28  0:00           ` Larry Kilgallen
1999-09-28  0:00           ` Steve Doiel
1999-09-28  0:00   ` Preben Randhol
1999-09-27  0:00 ` David Starner
1999-09-28  0:00   ` Robert Dewar
1999-09-28  0:00     ` David Starner
1999-09-29  0:00       ` Robert A Duff
1999-09-28  0:00     ` David Starner
1999-09-28  0:00       ` Robert Dewar
1999-09-28  0:00         ` Ray Blaak
1999-09-28  0:00   ` the middleman
1999-09-28  0:00   ` Robert Dewar
1999-09-28  0:00     ` GNAT listing file default names (was: Ada95 Strengths/Weaknesses) Larry Kilgallen
1999-09-28  0:00       ` Gautier
1999-09-29  0:00         ` Robert Dewar
1999-09-29  0:00       ` Robert Dewar
1999-09-29  0:00         ` Larry Kilgallen
1999-09-29  0:00           ` Robert Dewar
1999-09-29  0:00             ` Larry Kilgallen
1999-09-30  0:00               ` Robert Dewar
1999-09-28  0:00     ` Code size of Ada ? was Re: Ada95 Strengths/Weaknesses Alfred Hilscher
1999-09-28  0:00       ` Gautier
1999-09-28  0:00       ` David Botton
1999-09-29  0:00       ` Robert Dewar
1999-09-29  0:00         ` Alfred Hilscher
1999-09-29  0:00           ` Robert Dewar
1999-09-30  0:00             ` Alfred Hilscher
1999-09-30  0:00               ` Gautier
1999-09-30  0:00               ` Robert Dewar
1999-09-29  0:00         ` Larry Kilgallen
1999-09-29  0:00           ` Alfred Hilscher
1999-09-29  0:00             ` Ted Dennison
1999-09-29  0:00             ` Gautier
1999-09-29  0:00               ` Ed Falis
1999-09-29  0:00                 ` Gautier
1999-09-29  0:00                 ` tmoran
1999-09-30  0:00               ` Robert Dewar
1999-09-29  0:00             ` Robert Dewar
1999-09-30  0:00               ` Alfred Hilscher
1999-09-30  0:00                 ` Robert Dewar
1999-09-30  0:00                   ` Ehud Lamm
1999-09-30  0:00                     ` Robert Dewar
     [not found]                       ` <7t2e1l$lqt2@ftp.kvaerner.com>
     [not found]                         ` <37F91D6E.58685CFE@mitre.org>
     [not found]                           ` <7tf7uo$h2b$1@nnrp1.deja.com>
     [not found]                             ` <37FBA978.A86762F1@mitre.org>
1999-10-18  0:00                               ` Robert Dewar
1999-10-19  0:00                                 ` Robert I. Eachus [this message]
     [not found]                           ` <7tf7uo <37FBA978.A86762F1@mitre.org>
     [not found]                             ` <5OkO3.2$1e.659@typhoon.nyu.edu>
1999-10-19  0:00                               ` Robert I. Eachus
1999-09-30  0:00                   ` tmoran
1999-09-30  0:00                 ` Gautier
1999-09-30  0:00                   ` Robert Dewar
1999-09-30  0:00                   ` Robert Dewar
1999-09-30  0:00                   ` Robert Dewar
1999-09-29  0:00           ` Robert Dewar
1999-09-29  0:00           ` Robert Dewar
1999-09-28  0:00     ` David Starner
1999-09-28  0:00       ` Robert Dewar
1999-09-28  0:00       ` Robert Dewar
1999-09-28  0:00         ` David Starner
1999-09-29  0:00           ` Robert Dewar
1999-09-30  0:00         ` Pragma (was Re: Ada95 Strengths/Weaknesses.) Preben Randhol
1999-09-30  0:00           ` Preben Randhol
1999-09-28  0:00       ` Ada95 Strengths/Weaknesses Ted Dennison
1999-09-28  0:00         ` Simon Wright
1999-09-28  0:00       ` Gautier
1999-09-28  0:00         ` Ed Falis
1999-09-28  0:00           ` David Starner
1999-09-29  0:00           ` Robert Dewar
1999-09-28  0:00         ` David Starner
1999-09-29  0:00           ` Robert Dewar
1999-09-28  0:00       ` p.obry
1999-09-28  0:00         ` David Starner
1999-09-28  0:00           ` Richard D Riehle
1999-09-27  0:00 ` Steve Doiel
1999-09-27  0:00 ` J. David Bryan
1999-09-28  0:00 ` Geoff Bull
1999-09-29  0:00   ` the middleman
1999-09-29  0:00     ` Robert A Duff
1999-09-28  0:00 ` Geoff Bull
replies disabled

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