Deutsch   English   Français   Italiano  
<87ldwe6pb8.fsf@nosuchdomain.example.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: transpiling to low level C
Date: Tue, 17 Dec 2024 12:13:15 -0800
Organization: None to speak of
Lines: 68
Message-ID: <87ldwe6pb8.fsf@nosuchdomain.example.com>
References: <vjlh19$8j4k$1@dont-email.me>
	<vjn9g5$n0vl$1@raubtier-asyl.eternal-september.org>
	<vjnhsq$oh1f$1@dont-email.me> <vjnq5s$pubt$1@dont-email.me>
	<vjpn29$17jub$1@dont-email.me> <vjps0l$18hon$1@dont-email.me>
	<vjq36r$19sis$1@dont-email.me> <vjqcut$1bld5$1@dont-email.me>
	<877c7z85t2.fsf@nosuchdomain.example.com>
	<vjs871$1q22j$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Tue, 17 Dec 2024 21:13:16 +0100 (CET)
Injection-Info: dont-email.me; posting-host="be6ba1f9d988ebdec25093efcf540bc9";
	logging-data="1991943"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+oEez0Xk45cBc92n3HznL3"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:c+j1FjyMy1r/gKECEydERjKTrA0=
	sha1:iReWZJdiYKBIqjdC+PCUItfdiPo=
Bytes: 3999

bart <bc@freeuk.com> writes:
> On 17/12/2024 01:19, Keith Thompson wrote:
>> bart <bc@freeuk.com> writes:
>> [SNIP]
>>> In that case I've no idea what you were trying to say.
>>>
>>> When somebody says that 'goto' can emulate any control structure, then
>>> clearly some of them need to be conditional; that is implied.
>>>
>>> Your reply suggested they you can do away with 'goto', and use
>>> recursive functions, in a scenario where no other control structures
>>> need exist.
>>>
>>> OK, if this is not for an IL, then it's not a language I would care
>>> for either. Why tie one hand behind your back for no good reason?
>> I read Janis's post.  I saw a suggestion that certain constructs are
>> *theoretically* unnecessary.  I saw no suggestion of any advocacy for
>> such an approach.
>> """
>> A 'goto' may be used but it isn't strictly *necessary*. What *is*
>> necessary, though, that is an 'if' (some conditional branch), and
>> either 'goto' or recursive functions.
>> """
>
> This doesn't actually make much sense. So 'goto' is necessary, but
> 'goto' *is*?

I presume you didn't write what you intended to write.  Responding to
what I *think* you meant :

Either
    "if" and "goto"
or
    "if" and recursive functions
are theoretically sufficient to express certain kinds of algorithms
(I'm handwaving a bit).  Which implies that "goto" is not strictly
necessary.  It also implies that recursive functions are not strictly
necessary if you have "goto".

Since this is comp.lang.c, not comp.theory (or what comp.theory was
intended to be), I'm not going to go into the details, nor am I going to
take the time to express the concept in mathematically rigorous terms.

> If you try to extract any meaning, it is that any control flow can be
> expressed either with 'goto' or with 'recursive functions'.

Yes, either of those plus "if".  It appears you understand the point.

> This is what I picked up on. Who on earth would eschew 'goto' and use
> such a disproportionately more complex and inefficient method like
> recursive functions?

Perhaps it wasn't clear initially, but it should be by now,
that Janis was talking about what's theoretically sufficient to
express general algorithms.  You seized on the silly idea that
Janis was *advocating* the use of one of the two minimal methods in
an intermediate language for a compiler.  The idea Janis brought
up (briefly, in passing) is about theoretical computer science,
not practical software engineering.  (Janis, please correct me if
I'm mistaken.)

Repeatedly asking why anyone would do such a thing misses the point.

[...]

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */