Final Version
Total Page:16
File Type:pdf, Size:1020Kb
Centrum Wiskunde & Informatica Software Engineering Software ENgineering A comparison between the ALGOL 60 implementations on the Electrologica X1 and the Electrologica X8 F.E.J. Kruseman Aretz REPORT SEN-E0801 SEPTEMBER 2008 Centrum Wiskunde & Informatica (CWI) is the national research institute for Mathematics and Computer Science. It is sponsored by the Netherlands Organisation for Scientific Research (NWO). CWI is a founding member of ERCIM, the European Research Consortium for Informatics and Mathematics. CWI's research has a theme-oriented structure and is grouped into four clusters. Listed below are the names of the clusters and in parentheses their acronyms. Probability, Networks and Algorithms (PNA) Software Engineering (SEN) Modelling, Analysis and Simulation (MAS) Information Systems (INS) Copyright © 2008, Centrum Wiskunde & Informatica P.O. Box 94079, 1090 GB Amsterdam (NL) Kruislaan 413, 1098 SJ Amsterdam (NL) Telephone +31 20 592 9333 Telefax +31 20 592 4199 ISSN 1386-369X A comparison between the ALGOL 60 implementations on the Electrologica X1 and the Electrologica X8 ABSTRACT We compare two ALGOL 60 implementations, both developed at the Mathematical Centre in Amsterdam, forerunner of the CWI. They were designed for Electrologica hardware, the EL X1 from 1958 and the EL X8 from 1965. The X1 did not support ALGOL 60 implementation at all. Its ALGOl 60 system was designed by Dijkstra and Zonneveld and completed in 1960. Although developed as an academic exercise it soon was heavily used and appreciated. The X8, successor of the X1 and (almost) upwards compatible to it, had a number of extensions chosen specifically to support ALGOL 60 implementation. The ALGOL 60 system, developed by Nederkoorn and Kruseman Aretz, was completed even before the first delivery of an X8. In this document we describe the two systems, demonstrating the progress in both hardware and software in a relatively short period. 2000 Mathematics Subject Classification: 01-08; 68-03; 68N20 1998 ACM Computing Classification System: K.2; D.3.4 Keywords and Phrases: History of Computing; ALGOL 60 compiler; Electorlogica X1; Electrologica X8 A comparison between the ALGOL 60 implementations on the Electrologica X1 and the Electrologica X8 F.E.J. Kruseman Aretz September 16, 2008 ii ABSTRACT We compare two ALGOL 60 implementations, both developed at the Mathematical Centre in Amsterdam, forerunner of the CWI. They were designed for Electrologica hardware, the EL X1 from 1958 and the EL X8 from 1965. The X1 did not support ALGOL 60 implementation at all. Its ALGOl 60 system was designed by Dijkstra and Zonneveld and completed in 1960. Although developed as an academic exercise it soon was heavily used and appreciated. The X8, successor of the X1 and (almost) upwards compatible to it, had a number of extensions chosen specifically to support ALGOL 60 implementation. The ALGOL 60 system, developed by Nederkoorn and Kruseman Aretz, was completed even before the first delivery of an X8. In this document we describe the two systems, demonstrating the progress in both hard- ware and software in a relatively short period. 2000 Mathematical Subject Classification 01–08, 68-03, 68N20 1988 Computer science Classification K.2, D.3.4 Keywords and Phrases historical, ALGOL 60 compiler, Electrologica X1, Electrologica X8 Preface In this document we compare two ALGOL 60 implementations, one for the Electrologica X1, completed in 1960, the other for the Electrologica X8, completed in 1965. To give the flavour of the difference, we present below the results of some measurements, carried out with the help of emulations of the two machines, for one and the same program, a Runge-Kutta integration program applied to the calculation of planetary orbits. X1 X8 compiling instructions executed 1 145 895 2 270 261 compile time 61.9 sec 8.92 sec average instruction time 54.1 µsec 3.93 µsec execution instructions executed 9 450 329 1 705 131 execution time 557.3 sec 10.36 sec average instruction time 52.6 µsec 6.08 µsec Where the El X8 is about 12 times faster than the El X1, we see that program execution is more than 50 times faster. This is due to the fact that the X1 was developed for ad- ministrative applications in the first place, whereas the (upwards compatible) instruction set of the X8 was chosen with ALGOL–like languages in mind. In this report we compare the two machines, the two compilers and the object codes they generate, in order to explain the figures given above, as well as many others. Moreover go we in somewhat deeper in aspects of the ALGOL 60 implementation of the X8 that have not been described elsewhere. iii iv Contents 1 Introduction 1 1.1 TheMathematicalCentre . 1 1.2 Electrologica................................... 2 1.3 ALGOL60 ................................... 3 1.4 ALGOL60implementationontheMC . 4 1.5 Installationofthesystem. ... 6 1.6 MaintenanceoftheALGOLsystemfortheX8 . ... 6 1.7 TheZ8committee ............................... 7 2 The Electrologica X1 9 3 The ALGOL 60 system for the EL X1 15 3.1 Introduction................................... 15 3.2 Therepresentationofvalues . ... 17 3.3 Thestructureoftheobjectprogram. .... 18 3.3.1 Simple assignment statements . 18 3.3.2 Arrayaccess............................... 20 3.3.3 The <for–statement> ......................... 21 3.3.4 Procedurecalls ............................. 25 3.3.5 Somestandardfunctions . 29 3.3.6 Designational expressions and goto statements . ....... 30 v vi CONTENTS 3.4 Thestructureofthecompiler . .. 31 3.4.1 Thelexicalscanner ........................... 32 3.4.2 Theprescanprogram. 32 3.4.3 Thesecondormainscanprogram. 32 4 The Electrologica X8 39 4.1 Floating–pointinstructions. ..... 40 4.2 Newaddressingvariants . 42 4.3 Anewsubroutinecall.............................. 44 4.4 Theexecuteinstructions . .. 44 4.5 Some other additions to the X8 instruction set . ....... 44 4.6 The execution times of floating–point operations . ......... 45 5 The ALGOL 60 system for the EL X8 49 5.1 Introduction................................... 49 5.2 Thestructureoftheobjectprogram. .... 52 5.2.1 Simple assignment statements . 52 5.2.2 Arrayaccess............................... 53 5.2.3 The <for–statement> ......................... 56 5.2.4 Procedurecalls ............................. 59 5.2.5 Somestandardfunctions . 62 5.2.6 Designational expressions and goto statements . ....... 64 5.2.7 Linenumbers .............................. 66 5.2.8 Guardingstackoverflow . 67 5.3 Thestructureofthecompiler . .. 69 5.3.1 Overview ................................ 69 5.3.2 The General–purpose procedures . 71 5.3.3 Thetranslatorscan........................... 72 5.3.4 Themacroprocessor . .. .. 77 CONTENTS vii 5.3.5 Thesymboltable ............................ 78 5.3.6 Prescan1................................. 80 5.3.7 Prescan0................................. 81 5.3.8 Resultsofsomemeasurements . 84 6 Comparison of the two ALGOL 60 systems 87 6.1 ComparisonoftheELX1andtheELX8. 87 6.2 Comparison of the ALGOL 60 implementations . .... 89 6.2.1 Comparisonoftheobjectprograms . 89 6.2.2 Comparisonofthecompilers. 90 6.3 Resultsofmeasurements . 92 6.3.1 Summary of results of Chapter 3 and Chapter 5 . .. 93 6.3.2 An estimation of the X1 to X8 acceleration factor . ..... 94 6.3.3 Theprograms.............................. 96 6.3.4 Compiling ................................ 97 6.3.5 Programexecution . .. .. 98 6.4 The influence of line–number book–keeping . ......100 7 Final remarks 103 A Sample programs 105 A.1 Havieintegrator................................. 108 A.2 QReigenvalues .................................112 A.3 JAZZ164,Runge–Kuttaintegration . .118 A.4 SieveofErathostenes .. .. .. 125 A.5 Pentomino....................................128 A.6 Lispinterpreter ................................. 134 B User–manual extracts 155 viii CONTENTS B.1 ExtractoftheX1ALGOLusermanual . 155 B.2 ExtractoftheX8ALGOLusermanual . 161 References 169 Chapter 1 Introduction 1.1 The Mathematical Centre The Mathematical Centre (or shortly: the MC) was founded in 1946 in order to promote the application of mathematics in the Netherlands. The ideas for such an institute were developed during world war II and many parties, among which ZWO (Foundation for Pure Scientific Research), the city of Amsterdam, CBS (Central Bureau for Statistics), Philips Gloeilampen Fabrieken (now Philips Electronics) and the Bataafse Petroleum Maatschappij, contributed to its foundation. Soon it had four departements: for pure mathematics, applied mathematics (mainly ap- plied analysis), statistics, and numerical computation. The latter department was from 1947 to 19731 headed by Adriaan van Wijngaarden (who was president of the board of directors of the institute from 1961 until his retirement in 1981). After a study tour to the UK and the US the decision was taken to build a first computer, based on relay tech- nology. The ‘ARRA’ was developed by C.S. Scholten and B.J. Loopstra and completed in 1952, but it never functioned satisfactorily and was broken down shortly after its official inauguration. The structure of the next MC computer, called ‘ARRA II’, was highly influenced by G.A. Blaauw, who joined the MC from 1952 until 1955 and learned the profession in the US with Howard Aiken. It was completed in 1955 and worked successfully. It had a drum store of 1024 words of 30 bits (revolution time 20 msec). The basic software for 1The department for numerical computation was split into two departments Januari 1st 1973, each with a new head. 1 2 CHAPTER 1. INTRODUCTION the