Path: csiph.com!news.mixmin.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: Threads across programming languages
Date: Sat, 01 Jun 2024 21:03:49 -0700
Organization: A noiseless patient Spider
Lines: 77
Message-ID: <86y17ong7u.fsf@linuxsc.com>
References: <20240503180102.00002f98@yahoo.com> <86ikzqtwqr.fsf@linuxsc.com> <86cyppru3q.fsf@linuxsc.com> <86ikz6wmoo.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Sun, 02 Jun 2024 06:03:52 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="487e0958afb8d1cfa0659a77e612b1fd"; logging-data="3375916"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SK+HSI/ua7ijcIi0CIJx7G0Lp3dp+b84="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:By84vIbdKTY7zNAecWJnkdlfBp4= sha1:58TDA3llh4Z8aK2epy7D+TI/XNw=
Xref: csiph.com comp.lang.c++:119454
Paavo Helde writes:
> On 22.05.2024 06:27, Tim Rentsch wrote:
>
>> Paavo Helde writes:
>>
>>> On 14.05.2024 05:43, Tim Rentsch wrote:
>>>
>>>> Paavo Helde writes:
>>>>
>>>>> On 07.05.2024 01:13, Tim Rentsch wrote:
>>>>
>>>
>>>>>>
>>>>>> C++ doesn't need nested functions because it has lambdas, which
>>>>>> are effectively equivalent.
>>>>>
>>>>> Lambdas are better than nested functions as one can specify explicitly
>>>>> which variables are shared and how. One can be lazy and pass [&], but
>>>>> one doesn't have to.
>>>>
>>>> To me that sounds like all the complications of nested functions,
>>>> and more besides, and no real advantages. The choice of which
>>>> variables to share is syntactic sugar, there is no difference
>>>> in expressive power.
>>>
>>> Most of what programming languages do is syntactic sugar.
>>
>> You must mean something different by "syntactic sugar" than I
>> do.
>
> Just to clarify, for example many programming languages have syntax
> for defining functions or subroutines, which IMO can be viewed as
> syntactic sugar over JMP/GOTO which could be used instead.
>
> What the heck, even having named variables is syntactic sugar over
> numeric memory slots. I recall the programs written for programmable
> calculators in 1980-s did not provide such a luxury as variable names.
The problem here is that this notion of what "syntactic sugar"
means would make the term almost meaningless. It is well-known
that Turing completeness can be based on a very small number of
primitive operations, and in fact, that number can be one. It's
ridiculous to say all programming languages are just syntactic
sugar over a single operation.
Furthermore, this notion of "syntactic sugar" is at odds with
widespread and common usage. Look up "Syntactic sugar" on
Wikipedia.
>>> For just writing Turing complete code one programming language
>>> would be enough.
>>
>> That statement is true but irrelevant. C++ and PostScript
>> are both Turing complete, but it's absurd to suggest that
>> there are no significant differences between them.
>
> Absolutely agree, and most what makes them different is syntactic
> sugar.
That is utter nonsense. No one else thinks that.
> Adding numbers happens by the same CPU operations both in C++ and
> PostScript, but there is an enormous difference in how one has to
> write the orders to get these numbers added.
That's completely beside the point. To give one example, C++
has exceptions, and C does not. There is no simple and direct
mapping from C++ exceptions to the C language. There is no
modest syntactic layer that could be put on top of C so that
it would then have exceptions. The gap is semantic, not just
syntactic. What you are saying is that they are operationally
equivalent. Sure, but the transformation to get from one to
the other is a lot more than just syntax. That is the point
of the phrase SYNTACTIC sugar - it means only a modest difference
that is purely syntactic, and not involving significant semantic
disparities.