home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.forth      Forth programmers eat a lot of Bratwurst      117,927 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 116,314 of 117,927   
   Anton Ertl to Paul Rubin   
   Re: Closures   
   14 Mar 24 09:17:39   
   
   From: anton@mips.complang.tuwien.ac.at   
      
   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.   
      
   - anton   
   --   
   M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html   
   comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html   
        New standard: https://forth-standard.org/   
      EuroForth 2023: https://euro.theforth.net/2023   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca