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: 109fba,baaf5f793d03d420 X-Google-Attributes: gid109fba,public X-Google-Thread: fc89c,97188312486d4578 X-Google-Attributes: gidfc89c,public X-Google-Thread: 10db24,4cf070091283b555 X-Google-Attributes: gid10db24,public X-Google-Thread: 103376,97188312486d4578 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: What's the best language to learn? [was Re: Should I learn C or Pascal?] Date: 1996/08/27 Message-ID: <4vtvic$9on@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 176701579 references: <01bb8ded$c55ea3a0$87ee6fce@timpent.airshields.com> <3218CAD9.167EB0E7@ceco.ceco.com> <4vb001$hvd@news1.mnsinc.com> organization: Comp Sci, RMIT, Melbourne, Australia newsgroups: comp.edu,comp.lang.ada,comp.lang.c,comp.lang.c++,comp.unix.programmer nntp-posting-user: ok Date: 1996-08-27T00:00:00+00:00 List-Id: Here's the reference I promised. The IMP Language and Compiler P. D. Stephens EMAS report 6 Department of Computer Science, University of Edinburgh My copy says "Reprinted 1977"; it was also apparently published in The Computer Journal. IMP is basically a sort of Algol with dynamic arrays, records, pointers, bitwise operations, strings, and nested procedures. (Pointers to procedures were at one time provided, but dropped because they felt that the scope rules -- similar to Ada 95's -- "emasculated" the feature.) It's rather like C, but somewhat higher level. Here's the quotation: The EMAS programmers who had previous experience of high-level languages adapted easily to system programming in IMP. They produced compact, highly structured programs, which were easy to maintain or amend despite defects incommentary and/or documentation. They seldom worried about the efficiency of object code produced by the compiler, but their programs generally performed well. This group included the most productive programmers working on the [EMAS operating system] project. Programmers with a background of assembly language were less happy with IMP and seldom used its more advanced features such as recursion. They produced well commented and documented programs that nevertheless proved difficult to maintain since they lacked structure. This group worried about the efficiency of object code produced by the compiler to the extent of examining the listings of code produced, yet their programs were often large in size and slow in execution. Some of the least productive programmers were included in this group. Earlier in the report, they say that Two routines in EMAS and twnty in the compiler have been hand-coded [in assembler]. The gains in performance or reductions in size have varied from an encouraging 2% to a rather discouraging 40%. The majority have fallen into the 10% to 20% range. One routine in EMAS -- the interrupt analysis routine -- was originally written in assembly code. This routine has recently been rewritten in IMP and this time the IMP version is smaller by 11% and presumably faster by a like amount. ... The effect of [improvements to the code generator, most importantly the register allocator] is that the Release 8 compiler produces about half the amount of object code that Release 1 produced for the same program. Release 8 object code is rather more than twice as fast as Release 1 object code. Since the compiler is written in IMP, compiling speeds have increased similarly. These figures enable the 4 months spent hand coding analysis routines to be seen as the waste of effort it undoubtedly was. The bottom line is that thinking in assembly language terms, whether the programmers actually _wrote_ in assembly language or an Algol-like language, in the end led to _less_ efficient code. Draw your own conclusions about implications for teaching. -- Australian citizen since 14 August 1996. *Now* I can vote the xxxs out! Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.