Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: bart Newsgroups: comp.lang.c Subject: Re: Recursion, Yo Date: Fri, 19 Apr 2024 19:34:40 +0100 Organization: A noiseless patient Spider Lines: 76 Message-ID: References: <_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com> <8734roqmdb.fsf@bsb.me.uk> <20240416231134.00004066@yahoo.com> <86edb1xtjf.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 19 Apr 2024 20:34:40 +0200 (CEST) Injection-Info: dont-email.me; posting-host="d4e5c5a145d29e3635cfa4bb0d7129a7"; logging-data="3312196"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+l0se9x9MJZXSdfVJLzpdn" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:xMPuoI82lSDpysTAlNKlwj3k9A8= Content-Language: en-GB In-Reply-To: <86edb1xtjf.fsf@linuxsc.com> Bytes: 4917 On 19/04/2024 16:26, Tim Rentsch wrote: > Michael S writes: > >> On Mon, 15 Apr 2024 20:36:58 +0200 >> Janis Papanagnou wrote: >> >>> Algol 68 and C are so different that mutual understanding might be >>> difficult depending on personal background, focus, and fantasy. :-) >> >> Interesting take. >> I never learned Algol-68, but from pieces of info that I occasionally >> got I was always thinking of it as rather similar to 'C'. >> Both languages originated from common ancestor (Algol-60) and changed >> it in similar directions, e.g. blurring the line between operators and >> expression, making function pointers first class citizen, allowing >> declaration of variables at block scope. >> I think, in the past, when I remembered more about Algol-68, I had seen >> more similarities. > > Algol 60 already had block scope declarations. > > Algol 60 may not have had (pointer to) function/procedure variables, > but it did allow procedure identifiers as arguments to a procedure > call, and procedure variables are an obvious generalization. > > Relative to Algol 60, C slightly expanded what forms are allowed in > expressions, but mainly as a way to simplify the language syntax: > > * no separate cases for assignment / function call statements > > * so for()'s are more general and don't need specializing > > In contrast, in Algol 68 the notion of "expression" is expanded > to allow the possibility of arbitrary variable declarations and > loops (IIANM; certainly I am not an expert on Algol 68). > > Furthermore there are some significant differences between C and > Algol 60: > > * Algol allows nested functions (aka procedures), but C doesn't > > * Algol has call by name, C is strictly call by value > > * Arrays are first class types in Algol, but not in C (and C > has pointer arithmetic as an essential part of the language, > which TTBOMK is not the case in any Algol-derived language) > > * Algol is "strict" whereas C is "lax" - for example, in Algol > the controlling expression of an 'if' statement must be a > 'Boolean expression', whereas in C it's just any expression > > To me, Algol 68 represents an expansion and extension of the > Algol 60 language philosophy, whereas C represents a deliberate > departure from that philosophy; not necessarily a radical > departure, but a departure nonetheless. Certainly C has some > similarities to Algol 68, but I wouldn't say C and Algol 68 > are similar languages, only that they have a few similarities. I can't see any connection between Algol68 and C; I'm surprised at people who say they do. C was put together together as a systems language to do a job, not to implemement some esoteric concept of a language that few could understand. I understood it was based on languages like B and BCPL. Actually there is a closer connection between my systems language, created 10 years after C, which was also created for purely practical purposes, and Algol68, largely because I borrowed much of its syntax (including the interchangeability of statements and expressions). But I would be first to admit that the similarity stops there.