Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127133 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 829981ADC2C for ; Thu, 17 Apr 2025 11:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1744888611; bh=4JrlvSYCUWTqAp16mYFUHuwk35N1oVmr+mP9uvozdNg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=bhEhd7mOAcUI2PX8Q9doAWekyGsmQ2/nFtJFCAuKDH7FRn42r/4ZMvDdrtsDOaanU Qk9/5LlzryHIl2PzLEKDNI5uarV86aHPiiFrbyq+oTwFO3hqOEjsUXpKlzJx6sx23V /8aqT+55qI4VV1yBcXj3FSSLmPuqa7arH2mXXIsbbh2/u4O+USVoBbOLCpT/betOtW 4OcO0vS2AE3CDpQn8ORfvB/xZv0hYMzs0fgpiNFGJXx5n6XP/Miaxu4J2FDOxZbaRA SYVgxqtY5YZqQ5vU4kbC0ul8h7wYEbaNL+F7O81qXwe3WcDLn7fYn9L62PwhUCItgR HXAZWWhEoqkcQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 26BD5180086 for ; Thu, 17 Apr 2025 11:16:49 +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=0.6 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: Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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, 17 Apr 2025 11:16:44 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-54acc04516fso667517e87.0 for ; Thu, 17 Apr 2025 04:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744888744; x=1745493544; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ak0rS+1vIsDHy0ww4LiMftdA4Wo5/bryxsy5Zjgefbw=; b=Fud6z3ZYCdQS3M4W2p1uhrr2l71e6yjjWbXU+WYcazO1Nf8qvGDxNbG1Tb8PGT/+eZ h5WBA3AhXzuV/JRBOkFZuuCz1YKhohQshITSulM/XWa5j8y0JW+XnOXKGrWdhqz24Qk0 rcStz1KM8HHhPvfrAxDZOLysVLnBJajEYDwcmnaEpkd3bj8mpz1BHOUJydgW5iOtCiHV 4EAXm7h9j1yxwdAC+jSOX6e3CCC/rT+0jpSnn+ZraIXs4LyE9UcLNY5o4vAJ4L3CDxFK pDH8ZNNaIOZ1nePCwmhyd0pn3zpHW3ozp7v/0mqBUBm0Tq0DX/c+4VrlWg+8nNNfjXnj 8eog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744888744; x=1745493544; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ak0rS+1vIsDHy0ww4LiMftdA4Wo5/bryxsy5Zjgefbw=; b=ljTFvFJUaKk/2DIQDfE+7ePf/1Aca+GyNtdeQ4PUTD2Hxvy6zCnmyqe16vlVeXSm0J eZiIZr0pXFP0fQNU6ZLtcAQhTPwzqDiVFLtO7fKd7sRD6sb+V9OMRO2XkKHb1do6ZOTL QEqrj5ErjQlR67/bBTa0ftoPHdhilt0pTI9oM9hwSmxw3iQScxm/cpyooIiXAjaRvq1o lHur7zAlRex+Fe4QH/Q1/1ywev4k7o2RPfZ2lZt9+qaesZFf6OCsjk2f/F7FO/6oNXC0 3uB+mE2wx98LORcsGJGNdaKhwlbCv3gTTYWds9k1yZ3Kc/mI1LioUIgEH0eJuR5Ov82k RuvA== X-Forwarded-Encrypted: i=1; AJvYcCVnT/5qaop4fFMgiqAyoxFt1yZAX3XIqv7UKXX3Nn8uPeOJoZK1PPcjJdIW3phZoxLHCsQPWxBjnIs=@lists.php.net X-Gm-Message-State: AOJu0YzRS+L/3XEZy7LnydLKLb8n6+pw04RoWigyTjFwI5NUk8vTaXn/ fjo6qKUEzIStETRaD9+qrtAtIMl3OPVRJVYavhsPURA4KdAl/YSFYWlAepvlGOcOtEHpHABM82Q gU/zCXfZtlX2yowhxLwg++NPdygc= X-Gm-Gg: ASbGncuockIT28wA0yRdCd98N/pJ5Z8GuNk1wd0EuswR9KEhhf1rc1i8HYyFOuKsWyx nZIz1Uj3I6c9aA+heXwGXYdW1Nzz7hmnyg57grBHgwi6n4cYN70/z3gY6s26Z6gfE0n45A6WGAP 1UiUlOsewKzGVIWdEQ/g9I X-Google-Smtp-Source: AGHT+IH64Sj6l9WktnJ4kICrgU7qOmZJndDH/8yc/p6gj253cWGOmGKd+SxNYmN6c4hFGs/L9LXo476Wt7axQszSJZg= X-Received: by 2002:ac2:51cf:0:b0:54d:662b:c8a9 with SMTP id 2adb3069b0e04-54d662bc9bemr1963804e87.25.1744888743764; Thu, 17 Apr 2025 04:19:03 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 17 Apr 2025 12:18:49 +0100 X-Gm-Features: ATxdqUHVRkcT8bnnUs3wsVPNXmjZDboTq08J7ql3N-CuheHVvqA8auqEv3RgvVY Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC Stage 3 To: Edmond Dantes Cc: "Rowan Tommins [IMSoP]" , php internals Content-Type: multipart/alternative; boundary="000000000000beabfe0632f791a4" From: oladoyinbov@gmail.com (Oladoyinbo Vincent) --000000000000beabfe0632f791a4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Here are list of the problems i saw in this RFC: 1.) The `spawn` keyword might disqualify this rfc, i talked to alot of php devs about this rfc and they all had a similar complaint about the keyword, maybe a keyword choice poll might help when the rfc voting goes live. 2.) This whole rfc seem a little bit complex, which might ruin php codebase readability, let's keep things simple and concise, first impression matters for beginners and intermediate php programmers. 3.) Let's not derive impression from java at this point, PHP might look similar to java but programmers hate java for a reason, overbloated way of doing simple things. On Thu, 17 Apr 2025, 9:55=E2=80=AFam Edmond Dantes, w= rote: > Hello, Rowan! > > > I don't have time to dig into the details of this draft at the moment, > but will say that a vote in two weeks is not at all realistic. > I just used the Flow from the Wiki. :) > > > My only other comment at a very quick glance is that I see the Context > section is still included, and still has most of its complexity. > Almost every section of the RFC has a "Motivation" subsection, which > explains why a particular tool is needed and what problem it solves. > I removed everything from the RFC that is not directly related to > asynchrony or not essential at this stage. > > Yesterday I also received feedback that the RFC contains too many changes= , > so I can briefly summarize what=E2=80=99s new in this version compared to= the > previous one: > > 1. > > The Scope class can no longer be used in an await expression. A > separate method is now provided for waiting on a Scope, intended only = for > special use cases. > 2. > > Scope is now responsible solely for coroutine lifetime and error > handling. > 3. > > A TaskGroup class has been added for working with groups of tasks. It > is used explicitly with the expression spawn with $taskGroup. Together > with Scope, TaskGroup supports structured concurrency, offering > different strategies for tracking hanging coroutines. > > *These are the key changes.* > > *Secondary changes include:* > > 1. > > Syntax refinement > 2. > > Edge case handling > 3. > > Ability to extend spawn with logic > 4. > > Added combinator functions: all, any, anyOf, ignoreErrors > 5. > > A special function Async\protect() has been added for critical > sections that cannot be cancelled. > 6. > > Improved examples > > Contextual expressions like with $context and async blocks were removed > from the RFC as they are out of its scope. > > The next important step is to determine which coroutine model to choose. > There are three models in total: > > 1. > > Go =E2=80=93 no Scope > 2. > > Java Loom =E2=80=93 Scope is always passed explicitly > 3. > > The current RFC =E2=80=93 Scope is passed both explicitly and implicit= ly > > The choice of model affects both the syntax and the API. Therefore, if th= e > current model is not accepted, there is no point in further developing th= is > RFC =E2=80=94 a new one should be created instead. > > This is the key question I want to clarify at this stage. > > -- > > Ed > --000000000000beabfe0632f791a4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here are list of the problems i saw in = this RFC:

1.) The `spawn` keyword might di= squalify this rfc, i talked to alot of php devs about this rfc and they all= had a similar complaint about the keyword, maybe a keyword choice poll mig= ht help when the rfc voting goes live.

2.) This whole rfc seem a little bit complex, which might ruin ph= p codebase readability, let's keep things simple and concise, first imp= ression matters for beginners and intermediate php programmers.

3.) Let's not derive impression= from java at this point, PHP might look similar to java but programmers ha= te java for a reason, overbloated way of doing simple things.



On Thu, 17 Apr 2025, 9:55= =E2=80=AFam Edmond Dantes, <edmon= d.ht@gmail.com> wrote:
Hello, Rowan!

> I don't have time to dig into the details of this draft at th= e moment, but will say that a vote in two weeks is not at all realistic.I just used the Flow from the Wiki. :)

> My only other comment at a very quick glance is that I s= ee the Context section is still included, and still has most of its complex= ity.
Almost every section of the RFC has a "Moti= vation" subsection, which explains why a particular tool is needed and= what problem it solves.=C2=A0
I removed everything f= rom the RFC that is not directly related to asynchrony or not essential at = this stage.=C2=A0=C2=A0

Y= esterday I also received feedback that the RFC contains too many changes, s= o I can briefly summarize what=E2=80=99s new in this version compared to th= e previous one:

  1. The Scope class can no longer be used in an await expression. A separate method is now provided for waiting on a Scope, i= ntended only for special use cases.

  2. Scope is now responsible solely for coroutine lifetime and = error handling.

  3. A TaskGroup class has been added for working with groups of= tasks. It is used explicitly with the expression spawn with $taskGro= up. Together with Scope, TaskGroup support= s structured concurrency, offering different strategies for tracking hangin= g coroutines.

These are the key changes.

<= strong>Secondary changes include:

  1. Syntax refinement

  2. Edge case handling

  3. Ability to extend spawn with logic

  4. Added combinator functions: all, any, anyOf, ignoreEr= rors

  5. A special function Async\protect() has been added for critical = sections that cannot be cancelled.=C2=A0=C2=A0

  6. Improved examples

Contextual expressions like with $context and async= blocks were removed from the RFC as they are out of its scope.=C2= =A0

The next important step is to determine which = coroutine model to choose. There are three models in total:
  1. Go =E2=80=93 no Scope

  2. Java Loom =E2=80=93 Scope is always passed explicitly

  3. The current RFC =E2=80=93 Scope is passed both explicitly and implicitly=

The choice of model affects both the syntax and the API. Therefore, if t= he current model is not accepted, there is no point in further developing t= his RFC =E2=80=94 a new one should be created instead.

This is the ke= y question I want to clarify at this stage.=C2=A0=C2=A0

--

Ed

--000000000000beabfe0632f791a4--