In article <2024Mar14.101739@mips.complang.tuwien.ac.at>,   
   Anton Ertl wrote:   
   >Paul Rubin writes:   
   >>anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:   
   >>> is the HOPL paper) says that they just wanted an elegant specification   
   >>> that (I think) supports in-out semantics. What they wrote down was   
   >>> call-by-name, but they were not aware of all the consequences when   
   >>> they wrote it.   
   >>   
   >>I don't remember Algol syntax but I had thought using call-by-name as a   
   >>cheap inline function was idiomatic in it. E.g. to add up the first n   
   >>squares, you could say   
   >>   
   >> a = sum(i, 1, n, i*i)   
   >   
   >It may have become idiomatic after Jensen's device became well-known.   
   >That does not mean that it was intended.   
   >   
   >However, I don't think that it became idiomatic, because if it had   
   >become idiomatic, the successor languages of Algol 60 would have   
   >supported call by name, maybe as default, or maybe as a special option   
   >for passing parameters (syntactically similar to the VAR parameters in   
   >Pascal). None of that happened.   
   >   
   >If you want to see what happens if something becomes idiomatic, look   
   >at Lisp: The intention for the language was lexical scoping, but the   
   >implementation used dynamic scoping. By the time this was recognized   
   >as a bug, enough programs had been written that relied on dynamic   
   >scoping and enough programmers had become accustomed to this behaviour   
   >that they could not just fix it, but instead used a workaround (the   
   >FUNARG device) when they wanted to have lexical-scoping semantics.   
   >Eventually Common Lisp (started 1981, released 1984) added a separate   
   >syntax for lexical scoping to mainstream Lisp, but that was more than   
   >two decades after dynamically scoped Lisp had been implemented and   
   >become idiomatic.   
   >   
   >Another case is the story of S-expressions vs. (Algol- or ML-like)   
   >M-expressions in Lisp.   
   >   
   >>Sure, but Algol-60 didn't create the possibility of having to heap   
   >>allocate anything. So it avoided needing GC, which would have been a   
   >>big minus in that era. Lisp existed then but idk if it was actually   
   >>used for anything outside of research.   
   >   
   >And yet, Lisp had so much existing code by the time the scoping   
   >implementation was discovered as being buggy that they could not fix   
   >it. Algol-60 has been described as a publication language, so maybe   
   >there was actually more running Lisp code around than Algol-60 code.   
   >Sure, Burroughs used Algol-60 for their large systems, but they and   
   >their customers did not like Jensen's device themselves, or they did   
   >not participate in the development of other programming languages that   
   >received any scrutiny in language design discussions. In any case,   
   >call-by-name does not appear in any later languages that I have ever   
   >heard of.   
      
   In algol68 the unclean Jensen's device was replaced by references   
   once it was realized what it was. This permitted the same code,   
   without the mystification.   
      
      
   >   
   >- anton   
   --   
   Don't praise the day before the evening. One swallow doesn't make spring.   
   You must not say "hey" before you have crossed the bridge. Don't sell the   
   hide of the bear until you shot it. Better one bird in the hand than ten in   
   the air. First gain is a cat purring. - the Wise from Antrim -   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|