Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!execu!sequoia!rpp386!aubrey From: aubrey@rpp386.cactus.org (Aubrey McIntosh) Newsgroups: comp.lang.modula2 Subject: Re: FOR loops Message-ID: <18442@rpp386.cactus.org> Date: 4 Jul 90 17:31:23 GMT References: Reply-To: aubrey@rpp386.UUCP (Aubrey McIntosh) Organization: vima, Austin TX Lines: 67 In article Modula2 List writes: >Anyone else have any answers as to why Wirth designed such a restriction? Perhaps Randy Bush, or some ETH folk would care to comment on the following: Although one is perhaps overextended to speak for Wirth, I have at least read several of his papers, and --whether he intends or not-- I consistently come up with a few design philosophies in his work. 1) His papers have the 'flavor' or a mathemeticians writing. My BA degree is in math. So... a) A project should be complete for the original job/specification in mind. b) A project should be minimal. 'complete' and 'minimal' attain special meaning to a mathemetician. in lay terms, they keep their usual meaning, but it's pretty strong. Everything else seems subordinate to this. 2) The program is a document (formalized to a 'Text' now, in Oberon). a) Excessive obscureness, for performance, typically can be avoided through better algorithm abstraction, and failing that, better hardware. Failing that, N.W. seems able to design a new language. Before I carelessly start a flame war, let me point this out about my background. Once, in 1974, a Ms Comp. Sci major spent 4 months working in a 4Kb RAM environment trying to squeese 13 bytes out of a piece of code. Memory was about $1,000 / Kb, and a month's house payment was $85. I still tend to 'Hack,' but after studying N.W.'s papers, I leave it to the week before delivery, and my bug rate is fairly low. Anyway, I think this point focuses the preferences between the Pascal vs. C communities. b) Textual locality of reference actually improves program comprehension. 3) It is permissable to design the language, in part, to make the software development environment 'good.' a) Fast Compilation --> Simple language. b) Flexible or Custom Environment --> Libraries external to language. c) Correct products --> Safe language constructs, simple compilers. 4) Compiler optimization doesn't strongly interest him. At a talk, I heard him say that his one pass Modula-2 compiler used 20 year old compiler technology, he knew that, and one can only do so much with a handful of graduate students. Also, he believes that the language design itself influences the quality of code, and that optimization of a cumbersom language raises the risk of an incorrect compiler. --------------------- If these abstracts really represent(ed) Wirth's thinking, then I think the business of the FOR loop is kept simple, the references local, the optimization is built in (no assignments are legal to the loop variable within the loop: It is safe to put the value into any special place, such as registers, without execution time safeguards. -- Aubrey McIntosh "Find hungry samurai." -- The Old Man 1502 Devon Circle comp.os.minix, comp.lang.modula2 Austin, TX 78723 1-(512)-452-1540 (v)