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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ef33c33c4f98bde1 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Compiler for Z80/6510 Date: 1999/11/26 Message-ID: <81m4m4$ci0$1@nnrp1.deja.com>#1/1 X-Deja-AN: 553271523 References: <383c6fed.458467@news.fiam.net> <81k67s$47l$1@nnrp1.deja.com> <383DC86C.19A6F176@australia.boeing.com> X-Http-Proxy: 1.0 x26.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Nov 26 14:15:34 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-11-26T00:00:00+00:00 List-Id: In article <383DC86C.19A6F176@australia.boeing.com>, Peter Milliken 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.