Path: csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Bart Newsgroups: comp.compilers Subject: Re: not a lot of memory, was Optimization techniques and undefined behavior Date: Fri, 3 May 2019 12:45:02 +0100 Organization: virginmedia.com Lines: 41 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-05-018@comp.compilers> References: <19-04-021@comp.compilers> <19-04-023@comp.compilers> <19-04-037@comp.compilers> <19-04-039@comp.compilers> <19-04-042@comp.compilers> <19-04-044@comp.compilers> <19-04-047@comp.compilers> <19-05-004@comp.compilers> <19-05-006@comp.compilers> <19-05-016@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="6000"; mail-complaints-to="abuse@iecc.com" Keywords: history, performance, comment Posted-Date: 03 May 2019 13:51:26 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <19-05-016@comp.compilers> Content-Language: en-GB Xref: csiph.com comp.compilers:2254 On 03/05/2019 00:48, Bart wrote: > [There have been plenty of compilers that did bound checking.  Back in > the 1960s and 1970s the WATFOR Fortran compilers, originally for the > 7040 and later IBM 360/370 and later PDP-11 did bound checking and > also checks for uninitialized variables. > > IBM had two PL/I compilers, the checkout compiler that generated > interpreted code with extensive runtime checks and the optimizing > compiler that generated fast machine code.  It was possible if painful > to compile part of your program with one and part with the other and > link the code together.  Oh, and each compiler ran in 44K bytes of > RAM.  Take that, 8-bit micros. -John] That's a little unfair on 8-bit micros. Those other machines probably had the benefit of better instruction sets and wider register and data sizes. So 44KB could go further. They also probably made use of hard drives, while the 8-bit machines I used had floppy disks a lot of the time, which were too slow to use for things like multi-pass compilers. So more had to be done with a given amount of RAM. Looking up this particular compiler, it seems it was written in assembly language, while the ones I did for Z80, after the first one, were written in their own HLL. But the main pressure was in keeping generated code small, and ensuring it ran fast enough. Adding array bounds and numeric overflow checking wouldn't have helped. I suspect the IBM 360 was also somewhat faster than my 4MHz Z80. [My sources say the checkout compiler was written in PL/S, a PL/I subset IBM used for system programming. The 360 came in different models. The smallest was a 360/30 which you could configure with 64K of disk and a 5MB disk and card reader/punch and printer which I think was enough to run the PL/I compilers. It was really slow. A register-register add took 22us, 16 bit memory-register add 27 us, 32 bit multiply 235us. The 360 instruction set has 32 bit registers but the /30 implemented it in microcode with 8 bit data paths and the "registers" in core. -John]