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,1ea19776e3073a96 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: C/C++ programmer giving Ada95 a chance -- writing an emulator. Date: 2000/04/06 Message-ID: <8ciddt$2v7$1@nnrp1.deja.com>#1/1 X-Deja-AN: 607601339 References: <38e148e2.5089627@news.shreve.net> <38E2E979.3D1A95DE@research.canon.com.au> <38e7e951.8384503@news.shreve.net> <8c7j8c$plf$1@wanadoo.fr> <8c80ms$jnk$1@nnrp1.deja.com> <38E8F9C4.6D0E137@cadence.com> X-Http-Proxy: 1.0 x23.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Thu Apr 06 16:19:28 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-04-06T00:00:00+00:00 List-Id: In article <38E8F9C4.6D0E137@cadence.com>, Paul Graham wrote: > It sounds like the Realia compiler ran about as fast as grep or some > similar text scanning program. How did you achieve such compiler > speed? Is there something about COBOL that makes it easier to compile > than Ada? > > Paul No, in fact COBOL is a tough language to compile. But actually in my experience, grep on many Unix machines runs dismally slow, far slower than it should given the speed of disks, and the speed of processors today. Do some rough back of the envelope calculations a 2 million line COBOL program is typically about 70 million bytes long. Modern disks can easily read that much data in 10 seconds. Modern memories are large enough to hold all intermediate data, so the only output is writing the object file, and that will take less, say 5 seconds. Now let's suppose we compile using 10,000 instructions per line of COBOL, Realia COBOL is actually lower than this by quite a margin but let's see where that gets us. THat means that we need to execute 2 million x 10 thousand instructions = 2 * 10**10 instructions. A top of the line x86 machine (costing of the order of $2500) has a 1 gigahertz chip capable of executing at least two instructions per cycle in typical use, so that's 2 * 10**9 instructions per second. So our compilation requires 10 seconds of CPU time. Since this can be overlapped with reading the sources, there is no reason not to expect the compilation to be finished in less than half a minute. Could one write an Ada compiler that compiled this fast? Yes, but it would be a very large project. Is it worth it? No. As machines get faster and faster, fast compilation becomes less critical, and this trend will steadily continue. When Realia started, it is was really interesting that we compiled 10,000 lines/minute on a PC-1 with the competition only compiling 1000 lines/minute. But a few years later, when both figures were multiplied by a large factor, this became a much less critical competitive advantage. I must say I do miss the days when doing a full bootstrap of the compiler took 40 seconds with Realia COBOL, about the time to go get another Diet Coke from the fridge, but we are getting back to within hailing distance of that now with recent high performance machines, and indeed if you can afford a multi-processor top of the line SGI machine, you can indeed get compilation speeds this fast. I remember Jean Ichbiah in the late 80's coming up with the term Megaloch to describe compiler speed (millions of lines of code ber hour), and thinking we were not far from the first megaloch Ada compiler. Interesting that we have now overtaken that benchmark by a big factor already. Robert Dewar Sent via Deja.com http://www.deja.com/ Before you buy.