Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127136 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 AE0001A00BC for ; Thu, 17 Apr 2025 12:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1744891250; bh=BqZiwqzS+ixdR9SeJjM216Rpm0FsWvemZaGM4lOsg1M=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OprLvb8u6KJzSB3fCzGwAx3P1E+tJjAuEJyEmA+FRD7N25lxJVWZkncpvCeX3UYY4 bxBJQ0rs26AeEpNKXjaa3I4RcD3edQ4YhSSv3TJRYyxeD/aF6AgGZ5kpRqa6cfFalY nL2li6zkZD5PnTqz3q5yurcB6RYD+2KSf3bu25PMl1yvYOl4Zct6NVzVlFs5KM1wpQ mUY/szubghV1t944+BC1EJR8WWJREo99EDg6TNr1rPwn8VeE/B4ZZBvAto72LX3HvQ 4naCaV+VW+3eLRq6xFgKVK6N5IOGaXJxCf8p1Hz0EZIdBDITG3oAtgXuXDAzJw60k8 jjUf4g2/9k/pA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 20C9D18005B for ; Thu, 17 Apr 2025 12:00: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-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (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 12:00:48 +0000 (UTC) Received: by mail-yb1-f182.google.com with SMTP id 3f1490d57ef6-e6df1419f94so580653276.0 for ; Thu, 17 Apr 2025 05:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744891389; x=1745496189; 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=efrh59F5OvPNVpPfy67LrE8birnTtjFXsAtHfSjwCt4=; b=WUdj8FPQO2StCnIxccunbMaQVVcV2acgxvImW7MLRzzDsaqYDIOYH6GMH2hFyiKAja bbp9DWbyKdKQsPUO0IGN+3W8e0o1MJsF05oMPwj6SB6La7dK/BvA5osU9H+6rKSnBiFO LGzczLRtUwIgFxYmKSbyf9LW/gUAwsWVDJNgpSpUhkF36aLgF/0tvHK6xdF0SjHbeeYn HlUX3HFABwVkEd4CKkFGdfeixghNnJFjCIkpGxOoevNJPyMuMuqdlvTDUfcrI1oUPutu 7H5LRG14Pg6CbqpN00aE4c39mdP3nratdi7Pvr58b/2qfHckZGbOFqtq+2G7HCFFZGiY j0aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744891389; x=1745496189; 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=efrh59F5OvPNVpPfy67LrE8birnTtjFXsAtHfSjwCt4=; b=EoEkVE3/J6PTtxFC3XR20XyJ1Ef8u5TdJGBuRiuTBnL7VwomAkLCJvNHwry7nV4BOj J9qeQd3Kv0yy6UFWbtYCBICdwKYwzBiqmKTSAZP4b5+Nzcg0liofgijj/01F8hWJlICF pAYf+8hBtSldSKNHL2Sjvqz8fY+nqetbTicstzxyY63FgZXGeTDmy8xKaXhZ+BaO3EKg aPqcDN3haO+s+kBzHfer1VxBHAf6668L7inHx4gtjovYfKKEntkSbIZUG6ANRRuCQU3o HeakAQGh0yVtY6+7qaUcuSemMmW/ox93CtcgojamCSumiK674pAbiE5+5e3lG0x1f17X QtNw== X-Forwarded-Encrypted: i=1; AJvYcCUimlI6kr7yr3Z4Y2k3QQFqr1DNV6lEaMtfXddNK1L96SXwtfkRLocWo2DZ51NLHKD2mL9LbgdLwfE=@lists.php.net X-Gm-Message-State: AOJu0YyVLgvtw2JETbWsJ5nHvx4lSm7X1NVUYauW9wbcOiOtLLtebxIY m7pSHiM0RpFeA0ohshZr65Ici0taJKXJgJbs+2zzwVQjN2bTpRxt/G3+IJCj+U4uBf378PW951H q9knJcZKIbEMMswre4KtXdSPAL9E= X-Gm-Gg: ASbGncvYUx0tKTf9MdnH/Ap7vx//kRSTJwYu9yRP4PfZlW3CgW9isT0L+OldXdSs5lz 7pHOGWj+JB7Q4bwm6ouKAXo2bRm6ezZmJkMhdMoFDUGXJzDiP/oFm0jf1NHoHmcXf47FU+Gr+Nc w8SDkhOFfA0WXXjBqbtcafmA== X-Google-Smtp-Source: AGHT+IGG8eUc+n+Z0G+v80OapafsimYz/pNzeKaTYxDPwSNZqe66qmi+67JrycmeL1X06E7Kx5wLIGuwox3qbxRPFg4= X-Received: by 2002:a05:6902:140b:b0:e6d:f5e4:ff42 with SMTP id 3f1490d57ef6-e72757629fdmr6704508276.9.1744891389385; Thu, 17 Apr 2025 05:03:09 -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 15:02:58 +0300 X-Gm-Features: ATxdqUFw5DR8uQyuRvD1H9tqRvl6F4GWe7B7gvaBpBTn_d90BomLq-QBpjXtiKM Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC Stage 3 To: Oladoyinbo Vincent Cc: "Rowan Tommins [IMSoP]" , php internals Content-Type: multipart/alternative; boundary="0000000000006fa6920632f82fc6" From: edmond.ht@gmail.com (Edmond Dantes) --0000000000006fa6920632f82fc6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, Vincent. > 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. To have any kind of vote, we need multiple options. The keyword spawn is currently the best candidate. If you have a better one, I=E2=80=99m open to suggestions. > 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. I don=E2=80=99t understand how this RFC could make code harder to read. Can= you give a specific example? And what exactly do you think would be difficult for beginner programmers? If you know a simpler way to express spawn function + await, I=E2=80=99m op= en to suggestions. > 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. First of all, I=E2=80=99m not taking inspiration from Java. This RFC is the= result of a deep analysis of requirements, solutions, and implementation options = =E2=80=94 and I approach all of this primarily as a PHP developer, since PHP is where I have the most experience. I wouldn=E2=80=99t recommend paying attention to Java hate, because Java is= one of the most widely used languages (probably second only to C). It=E2=80=99s a general-purpose language used across a broad range of domains. It=E2=80=99s= also a language in which error research and use case studies are conducted =E2=80= =94 by some of the brightest minds. Ignoring the experience of Java just because of the illusion of =E2=80=9Chate=E2=80=9D would be shortsighted =E2=80=94 t= hat hate is more likely caused by the fact that there=E2=80=99s no such thing as a universal tool. As for Java Loom, its model is the closest to PHP =E2=80=94 because of hist= orical reasons. The second closest model is Python, which also has a similar history of adopting async features later. Both languages didn=E2=80=99t hav= e built-in async from the beginning, which makes their experience particularly relevant to PHP. Go, on the other hand, was designed from the ground up for concurrency =E2=80=94 that makes its lessons less applicable. And finally, the most important point: this RFC is exactly the way it is *because* it is designed for PHP, not for Java. For example, in Java you are always required to define a Scope. In Python, you always define a TaskGroup. Python has context managers to help simplify this. Java only offers explicit scope handling. This RFC gives developers the ability to write simple code without explicitly interacting with a Scope, while still benefiting from structured concurrency and coroutine control. And coroutine control is critical for frameworks and real-world projects. Without points of responsibility for control, you can=E2=80=99t write relia= ble PHP code or catch errors easily. If you think the Go approach is simpler =E2=80= =94 that=E2=80=99s a misconception. Go is not beginner-friendly. Go demands a d= eep understanding of async and strict discipline. Go and Rust developers (as shown in the study linked in the RFC) are very strict in their use of concurrency. PHP developers are used to a different style =E2=80=94 PHP ten= ds to forgive mistakes. Every part of this RFC exists not out of personal preference, but to solve real, practical problems. > --0000000000006fa6920632f82fc6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello, Vincent.=C2=A0

> T= he `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, mayb= e a keyword choice poll might help when the rfc voting goes live.

To have any kind of vote, we need multiple options. The key= word spawn is currently the best candidate. If you have a bett= er one, I=E2=80=99m open to suggestions.=C2=A0=C2=A0

>=C2=A0 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.
<= br>
I don=E2=80=99t understand how this RFC could make code harde= r to read. Can you give a specific example? And what exactly do you think w= ould be difficult for beginner programmers?

If you know a simpler way to express spawn functi= on + await, I=E2=80=99m open to suggestions.

= > 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 w= ay of doing simple things.

First of all, I=E2=80=99m= not taking inspiration from Java. This RFC is the result of a deep analysi= s of requirements, solutions, and implementation options =E2=80=94 and I ap= proach all of this primarily as a PHP developer, since PHP is where I have = the most experience.

I wouldn=E2=80=99t recommend pa= ying attention to Java hate, because Java is one of the most widely used la= nguages (probably second only to C). It=E2=80=99s a general-purpose languag= e used across a broad range of domains. It=E2=80=99s also a language in whi= ch error research and use case studies are conducted =E2=80=94 by some of t= he brightest minds. Ignoring the experience of Java just because of the ill= usion of =E2=80=9Chate=E2=80=9D would be shortsighted =E2=80=94 that hate i= s more likely caused by the fact that there=E2=80=99s no such thing as a un= iversal tool.

As for Java Loom, its model is the clo= sest to PHP =E2=80=94 because of historical reasons. The second closest mod= el is Python, which also has a similar history of adopting async features l= ater. Both languages didn=E2=80=99t have built-in async from the beginning,= which makes their experience particularly relevant to PHP. Go, on the othe= r hand, was designed from the ground up for concurrency =E2=80=94 that make= s its lessons less applicable.

And finally, the most= important point: this RFC is exactly the way it is because it is = designed for PHP, not for Java. For example, in Java you are always require= d to define a Scope. In Python, you always define a Task= Group. Python has context managers to help simplify this. Java only = offers explicit scope handling. This RFC gives developers the ability to wr= ite simple code without explicitly interacting with a Scope, w= hile still benefiting from structured concurrency and coroutine control.

And coroutine control is critical for frameworks and r= eal-world projects. Without points of responsibility for control, you can= =E2=80=99t write reliable PHP code or catch errors easily. If you think the= Go approach is simpler =E2=80=94 that=E2=80=99s a misconception. Go is not= beginner-friendly. Go demands a deep understanding of async and strict dis= cipline. Go and Rust developers (as shown in the study linked in the RFC) a= re very strict in their use of concurrency. PHP developers are used to a di= fferent style =E2=80=94 PHP tends to forgive mistakes.

Every part of this RFC exists not out of personal p= reference, but to solve real, practical problems.

--0000000000006fa6920632f82fc6--