Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126598 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 9C7911A00BC for ; Thu, 6 Mar 2025 09:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741252498; bh=9F72TKeJnyQtrU77DXQ8qxczsujj9ALasTkLeiy9Wyc=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Uk1Ysbbg3RPTqm6+2BccOjNfSmlW3us2QwbuQatkaLgqmHK4JyDZqBEYu7iE8KlqN kkwHVMLGrwRr2wq8808QGP5e/1ugjyxes2Zx7EesYWdMfHkZE/vPbRBi6rM/HuIKFy 17UGWfvpX2JnRxcxZHwTAgRSvhAGDc6u83M/mW6M39Cki/F19fRhCFk1q1DrYX/AQw maC/xNK+zOaewAAIE4rVxC+8BdqfQ0GD0mLvXmvDneTD8mikNyLVbS9NeS5g/pB1z5 J+DlOE/5L5f5QRvoq9YW2npS6irIsnE7GGYQd+E3XrYOdAjtAwImpOL2GAs1OPNWBL UlNY0+lMyvP2A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B445418004B for ; Thu, 6 Mar 2025 09:14:57 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (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 ; Thu, 6 Mar 2025 09:14:57 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 837071140120 for ; Thu, 6 Mar 2025 04:17:32 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 06 Mar 2025 04:17:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1741252652; x=1741339052; bh=5Yx7VjK+d9bD50ZzWuTLZ7ExgoYrwYAwCurf0UgWB48=; b= QXrFV3DS6A/B2iCVJARzrU8ZOjGwTaAH7wS2Y/AB79cQ9FI5Q25PQBP/9jhUxFVx Q00osnRNyoFTSWixFtmwARDtAB1t79j9krnmI12GczABgUGv/Rl3xA6+QR2Gj6DB uzQVo8TupeMBfwtFkzaKOULryXe0qM1I6O8Bz0bVhtUm6KYFs+3+37Yps4QP8W6M PL89hNTSyHytbs0+FrNiIuABBpUXxRX8wDgsud06mZDC0jXPHLGkWgtevQzfww0y JD9DpX4ojc9xdb1ku+awB5rgByU16iMde+gqNWcMqGL7FODy0Gzw+vWM/A6juPuw 4RVNaRMNW0wsmfNaKtNy2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1741252652; x=1741339052; bh=5 Yx7VjK+d9bD50ZzWuTLZ7ExgoYrwYAwCurf0UgWB48=; b=LW1pTeY2WjNkNoWzA 8M+iedEZWgVTWDde7sqyvZHGNPsTmA+Jtq3AQemln6I32+/wNKMxlpGOsVBxQRhz YjrOUtGPxW0i4+z0f05jC+Ba1gAWtwduyeNlBvJ/F9rqdFOOzL/x08x1iDODJN9k V1pDLG1y0cLyrpjwJRiuFxm+cbDSa7040txKVNb0Wlc6Rmhk7pBIVO/At3KFkE2p HYBBrj5rIUrmkjaHLJ6UKjISokejYt/NuiYipXsje4WTpOdXHX/BXNL+l03O40tZ eSpVwKB+NqIS+S7B2jAR/yHU944it/3hHAJDp4Ougb3/uU0RvIOnzVZQQJyVjZ+b ZihMw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutdejfeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff ggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhm ihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqe enucggtffrrghtthgvrhhnpeejkefghfeugffgtdeuheeggfdugefhudekjefhteegieej leehveelhfefvdfhudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthht ohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslh hishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 6 Mar 2025 04:17:31 -0500 (EST) Message-ID: <36cee7e3-2ef8-4f96-a72e-e67a99e5f9bb@rwec.co.uk> Date: Thu, 6 Mar 2025 09:17:28 +0000 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] PHP True Async RFC To: internals@lists.php.net References: <9964db8c-0ffe-43d5-8246-47fc76b07180@app.fastmail.com> <78a03dd0-fd4a-4f4a-ad8a-37e5704f06fc@app.fastmail.com> <23e162f6-54b0-4564-9d79-7b3bdc3d1ab5@rwec.co.uk> Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 06/03/2025 07:49, Edmond Dantes wrote: > > Defining new syntax would encourage us to define a minimum top-level > > behaviour, such as "inside an async{} block, these things are possible, > > and these things are guaranteed to be true" > > True. This is precisely the main reason not to change the syntax. The > issue is not even about how many changes need to be made in the code, > but rather about how many agreements need to be considered. Quite the opposite: with a function-and-object approach everything needs a name, an API, and a way of being described in relation to how the language already works. In a syntax-and-semantics approach, we only need to describe the things people actually need. The generator implementation doesn't have a name or API for where the value on the right of a "yield" goes, or where the value on its left comes from; we just describe the behaviour: values passed to yield somehow end up in the calling scope's Generator object, and values passed to that object somehow end up back at the yield statement. We don't have to define the API for a GeneratorContext object, and the semantics of what happens when users pass it around and store it in different scopes. In the same way, do we actually need to design what an "async context" looks like to the user? Do we actually want the user to be able to have access to two (nested) async contexts at once, and choose which one to spawn a task into? Or would we prefer, at least in the minimum implementation, to say "when you spawn a task, it spawns in the current async context, and if there is no current async context, an error is thrown"? -- Rowan Tommins [IMSoP]