Path: ...!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Recursion, Yo
Date: Fri, 19 Apr 2024 08:26:44 -0700
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <86edb1xtjf.fsf@linuxsc.com>
References: <_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com> <8734roqmdb.fsf@bsb.me.uk> <20240416231134.00004066@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Fri, 19 Apr 2024 17:26:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0518bb4613e9ed3dcecbcbf6c934dda9";
logging-data="3232813"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XG+xxf2BjlTESBRHpPxFUw0QvmfA3eAM="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:hl1tI0x9t4TuPwP99VYQNtflv9o=
sha1:hgOpYQfsl9zT6oQ9M4wPeM6pwbw=
Bytes: 4100
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.