Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:126642
X-Original-To: internals@lists.php.net
Delivered-To: internals@lists.php.net
Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5])
	by qa.php.net (Postfix) with ESMTPS id 0FA9C1A00BC
	for <internals@lists.php.net>; Sat,  8 Mar 2025 10:58:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail;
	t=1741431336; bh=1ImN3AGf0AdDUT7jt2lkaOdIx+vinCF2TJMpqBXz99U=;
	h=Date:From:To:In-Reply-To:References:Subject:From;
	b=Vq4VIFOQcCjBbONIcvFVWknN87E6fnLn7bWjhy8k5vicaRPqSbtQwieKdRD+N0SSB
	 g/ALzaOE6uHmDFccGPrH8Ze7ooWuACaEqikHyZqhnd95x6nY0Eli6P5nsN0PvZIvUE
	 fRKj132wf9wQ1UUeo28Akkq+6U4AspOV4AnHNrILRDGPIsCo+XAyiWRlXsFx/ko1HN
	 3zh1xr1b/z861wZWKmnCyU24uig0yYtHH34RiQRSNK0yKBgzhROk86SwPV+CywVqf1
	 iqA91aOY4g6SE6Jnfp9P69xogC573P3IvZhOSVL6+f2lXEPdRY8bQR6kkgvOBmSI/0
	 XyOLoREbdLfTw==
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id D719518006B
	for <internals@lists.php.net>; Sat,  8 Mar 2025 10:55:35 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_50,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM,
	HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,
	SPF_PASS autolearn=no autolearn_force=no version=4.0.0
X-Spam-Virus: No
X-Envelope-From: <daniil.gentili@gmail.com>
Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by php-smtp4.php.net (Postfix) with ESMTPS
	for <internals@lists.php.net>; Sat,  8 Mar 2025 10:55:35 +0000 (UTC)
Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5e6194e9d2cso777244a12.2
        for <internals@lists.php.net>; Sat, 08 Mar 2025 02:58:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1741431489; x=1742036289; darn=lists.php.net;
        h=mime-version:subject:references:in-reply-to:message-id:to:from:date
         :from:to:cc:subject:date:message-id:reply-to;
        bh=5Zi0UAgWJn/YerEhcoePUb3/EyKifU0+jJz7woUtYVY=;
        b=Q6g2miT5jAAQIcXrCSNzRGj/VoQWBNjbllgTaqP56U5+hXRtJLlGyCF7Tg609PuAgg
         Dr0J7E0ihNNTdBl6sy22CulFprRX0Y5d2829NGYBAxd0MERMn1AKx2P+sZzLBssTWOPq
         a0EGhSCKz9grpLzu3Pguiz4QMOPU2ZRHRGaHGaYOV8LMi0hw7gDPUp+tYR/4huSQDH76
         H+coXKf5TqrDNgBd7XWPEPNU47/FetsnSWmOGs4cGY4s5gQvuB+M7T0GUK3aX7kwT4RN
         M7SJ8IuNKNxtevRxD1hts9OOuNIbdZmZCLf4fRET66Lnz7cQ3hO8trdIj42LYVdIHV7g
         NDDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1741431489; x=1742036289;
        h=mime-version:subject:references:in-reply-to:message-id:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=5Zi0UAgWJn/YerEhcoePUb3/EyKifU0+jJz7woUtYVY=;
        b=Y9uHB/A3ig84Y8fNbBXTsjpZMttCXdiksKR+k2qhSQCbfxm6d1V5Ez1ZCJMQ1SK9wF
         K/Qp60fYogfHc35Chf1BGUl6XbKYvjUu07yJ/S3eWop0W0/I/Qw244vkP5MphNXXQ/M2
         /Dk0DT7ylTPRxJBWP2wmp0gALAc96sOYSntB/ua0mvCHEJdWjYvseV1EsjKBLdN7zUJT
         hXtrP87t3Q8dBfD6uLg8OSi1rS3jmvr2N6S6aDlo4cZB0q0rrNOdqPrIA5Xr2a5cSYtk
         VPWSnwrtudZw3c4a28jY2Mzpvf6DaraMeGognePuzTKwMEGFERrNXEnSq9xzRhQ7JYhI
         /heQ==
X-Gm-Message-State: AOJu0YzV6HkXsn8vjvxiYOuvthOy+ZJl40Bd6Teudb3TdzLszIFNS2OW
	DZIM9UASoOdXKjsTe9L5YJk4BQLtO38lpJo66nP4EcZiDqcqO5CvPRppzQ==
X-Gm-Gg: ASbGnctwSWHX+Nnq1ErNrznCxG/2GrqLucBGzIaE8385YWfR+MGREcExkehjAj0txmw
	HBjLK+RfIilLJr2rPtDWbeIuIMT+tf7I5DqVUtSiGf5OXXJ0K+SYJEgUERZWUEfq3NmMs9cA6Ll
	mlqyKqPQJq8k5w3oMgyJlBnFfIp9jZCWQZQ8Cj6itq+SuHrtTfXYKSLF/Gqzh+XDf1pKin+kySa
	h9jCvtq0/9DB+5akUMliWLyoi8r991FldsU1YgIWlswuOnnfpGaFuZuB08E39c/22jBi9DUjksX
	ceWFDPnDIKbMPUFqo9MMzawPCl0nMui27yCGrBeiC8xuQEBDVxkb/Iwj3Wq3lIyWqonKe7WYZOI
	bj1UM2bCQkqMw9Sq771p+6OCt46Iw
X-Google-Smtp-Source: AGHT+IHXlMwV9Xr2VfWXHdviO8lyvsBwDXQqIu2jsZendDcQ5NIaBvmuZhca4da+mRrDco8/SilnYg==
X-Received: by 2002:a05:6402:3496:b0:5e5:bde4:7575 with SMTP id 4fb4d7f45d1cf-5e5e22bf9c2mr6281722a12.1.1741431488518;
        Sat, 08 Mar 2025 02:58:08 -0800 (PST)
Received: from ?IPv6:::1? (luna-749a6f85f554075d0000f.net.as198747.daniil.it. [2a0e:97c0:38f:0:d570:455f:58f6:a947])
        by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5e5c766a5f7sm3804098a12.58.2025.03.08.02.58.07
        for <internals@lists.php.net>
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Sat, 08 Mar 2025 02:58:08 -0800 (PST)
Date: Sat, 8 Mar 2025 11:58:01 +0100 (GMT+01:00)
To: internals@lists.php.net
Message-ID: <db71834a-9ba7-47d3-8d06-0531eee9f0a0@gmail.com>
In-Reply-To: <05c426b4-4cea-46c3-9013-aa6cfb8b18b4@app.fastmail.com>
References: <CAMW7n8AJckEDzhGv9BdjNhq8zAdCqb4HsVr56vGi+izw50X6Dg@mail.gmail.com> <9964db8c-0ffe-43d5-8246-47fc76b07180@app.fastmail.com> <CAMW7n8CM7oBfXCDsKtV4hTFs40UmLCU3183WjYE2exLNqKDWLQ@mail.gmail.com> <78a03dd0-fd4a-4f4a-ad8a-37e5704f06fc@app.fastmail.com> <CAMW7n8C-Z18MKhyDX2+ofg70cRbwWOk=YWDAZpKtfLZsFVVRng@mail.gmail.com> <bb7a9f8f-0422-45e5-b4fc-f5757add92b4@app.fastmail.com> <CAMW7n8BnzL7d0bd_Y_jGOmyWegKQpm-FzrVFRCcDe=bNFZpi+A@mail.gmail.com> <08c8ad0b-e8f4-46e3-99f0-b80748d40b89@app.fastmail.com> <07973EAE-2D83-47A8-8FA0-84286C77C02B@rwec.co.uk> <48d66433-3ae9-4895-8361-7c81a0a3670d@app.fastmail.com> <be7cb263-93a1-4bd8-9416-ae4d3e0bafe6@rwec.co.uk> <dbce8889-016a-4c59-864c-d8fdec895adc@app.fastmail.com> <CAM0Ccxh=bydoDEHBAV+Gb1_86HJjwhW06kzEsdRiMh93k1F7oA@mail.gmail.com> <05c426b4-4cea-46c3-9013-aa6cfb8b18b4@app.fastmail.com>
Subject: Re: [PHP-DEV] PHP True Async RFC
Precedence: bulk
list-help: <mailto:internals+help@lists.php.net
list-unsubscribe: <mailto:internals+unsubscribe@lists.php.net>
list-post: <mailto:internals@lists.php.net>
List-Id: internals.lists.php.net
x-ms-reactions: disallow
MIME-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_18_258601567.1741431481612"
X-Correlation-ID: <db71834a-9ba7-47d3-8d06-0531eee9f0a0@gmail.com>
From: daniil.gentili@gmail.com (Daniil Gentili)

------=_Part_18_258601567.1741431481612
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

> you=C2=A0//never// get to decide unless you wrap it in a specific form (a=
sync\run or async\async, in this RFC), which ironically colors the function=
.

You're wrong, it does *not* color the function: spawning a new fiber does n=
ot make the code running it async: it is always async, regardless of whethe=
r you use async() or not, but when not using async(), it's simply the only =
async execution flow running.

> can't think of any way around it. My biggest issue with this RFC is that =
it results in=C2=A0**multiple** colors: FiberHandle, Future, and Resume.=C2=
=A0


You misunderstand again, colors are not objects or classes, colors are spec=
ial and annoying keywords (red, blue, await) that must always be added to c=
all functions of the same color (red, blue, await).

The FiberHandle is literally just a handle associated with the execution fl=
ow spawned with async(), it is not in any way associated with the spawned f=
unction, nor it is required in any way to invoke the spawned function.

Adding colors to functions makes async unnecessarily complex to use, for no=
 good reason at all (no, forcing developers to explicitly know if a functio=
n is async or not is not a good enough reason, when I write code I want to =
get things done, when I want to parallelize execution of something I use go=
/async(), when I don't, I couldn't care less about what the function does i=
nside, and I especially do not want to do a lot of hoop jumping to use it o=
r use other common patterns like functional composition).

Again, take a look at how nicely golang handles concurrency with colorless =
functions: php fibers weren't the first to do it.

Regards,
Daniil Gentili.

------=_Part_18_258601567.1741431481612
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<html>
 <head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 </head>
 <body>
  <span dir="ltr" style="margin-top:0; margin-bottom:0;">&gt; you&nbsp;//never// get to decide unless you wrap it in a specific form (async\run or async\async, in this RFC), which ironically colors the function. </span>
  <br>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">You're wrong, it does *not* color the function: spawning a new fiber does not make the code running it async: it is always async, regardless of whether you use async() or not, but when not using async(), it's simply the only async execution flow running.</span>
  <br>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">&gt; can't think of any way around it. My biggest issue with this RFC is that it results in&nbsp;**multiple** colors: FiberHandle, Future, and Resume.&nbsp;</span>
  <br>
  <br>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">You misunderstand again, colors are not objects or classes, colors are special and annoying keywords (red, blue, await) that must always be added to call functions of the same color (red, blue, await).</span>
  <br>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">The FiberHandle is literally just a handle associated with the execution flow spawned with async(), it is not in any way associated with the spawned function, nor it is required in any way to invoke the spawned function.</span>
  <br>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">Adding colors to functions makes async unnecessarily complex to use, for no good reason at all (no, forcing developers to explicitly know if a function is async or not is not a good enough reason, when I write code I want to get things done, when I want to parallelize execution of something I use go/async(), when I don't, I couldn't care less about what the function does inside, and I especially do not want to do a lot of hoop jumping to use it or use other common patterns like functional composition).</span>
  <br>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">Again, take a look at how nicely golang handles concurrency with colorless functions: php fibers weren't the first to do it.</span>
  <br>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">Regards,</span>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">Daniil Gentili.</span>
  <br>
 </body>
</html>
------=_Part_18_258601567.1741431481612--