From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,81cf52699486abe7 X-Google-Attributes: gid103376,public From: "Robert I. Eachus" Subject: Re: Code size of Ada ? Date: 1999/10/19 Message-ID: <380C9B88.9B4E6D5A@mitre.org>#1/1 X-Deja-AN: 537981333 Content-Transfer-Encoding: 7bit References: <37EED7B8.245C0054@yukyonline.co.yuky> <7smp30$9aa1@news.cis.okstate.edu> <7sp8m9$a6e$1@nnrp1.deja.com> <37F0D03C.DE4807D4@icn.siemens.de> <7srnb9$2u3$1@nnrp1.deja.com> <1999Sep29.075617.1@eisner> <37F22BB1.F3524D60@icn.siemens.de> <7sts6b$kla$1@nnrp1.deja.com> <37F349BB.B1F39ECF@icn.siemens.de> <7svmrk$tkl$1@nnrp1.deja.com> <7t0eo1$hd0$1@nnrp1.deja.com> <7t2e1l$lqt2@ftp.kvaerner.com> <37F91D6E.58685CFE@mitre.org> <7tf7uo$h2b$1@nnrp1.deja.com> <37FBA978.A86762F1@mitre.org> <7ue1ds$oqi$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.mitre.org X-Trace: top.mitre.org 940350035 14650 129.83.41.77 (19 Oct 1999 16:20:35 GMT) Organization: The MITRE Corporation Mime-Version: 1.0 NNTP-Posting-Date: 19 Oct 1999 16:20:35 GMT Newsgroups: comp.lang.ada Date: 1999-10-19T16:20:35+00:00 List-Id: 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...