Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124208 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 236411A009C for ; Thu, 4 Jul 2024 00:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720052791; bh=6dQn8mkMpPj2EFiHdqudcPc35yGuJMsVt+/5JfUXIaw=; h=References:In-Reply-To:From:Date:Subject:To:From; b=oIRp2vAQEjLtv4PxBXY9ms08LP50++MCJcDKxvBM6/1cPHJHhTe6aVANthGR8d/rX l9jyN0bxNBfoMx6weIDwrHsJvMfWJvPgqgAIWoQ+J0YaHm5aVCUXwq92zHFk+rrgql XtF1UmvlENrCKS96nAjjPFUs6U8pVfrKUv6xW2pJpAOeGnwirg4D/wmecEkEgi1R7x 2+kvTjDpKrNeCDgYhyz1JT5ne8w+dswJRT4LPW0hB1ACZIJGFGVfTnicWLfMiLRygG QzsKybP/uyh0saxyedABXEO3FCQBjm4/YVD/LOpllI+yfSv/yx8XKMY2yK5i/g561d m9TRln+ZZN6bQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 27B49180082 for ; Thu, 4 Jul 2024 00:26:29 +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,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.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, 4 Jul 2024 00:26:26 +0000 (UTC) Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6ae093e8007so306416d6.3 for ; Wed, 03 Jul 2024 17:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720052703; x=1720657503; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=WWSfQHwTSmbCvLiObSO+1gqU+AxGW0kNmjDcdRw7nhc=; b=dSggh3D3nmgPEn/oeUGMltxffk9EwYz/ete6EYAnkjQuzE5z6aoDTNvfmWPVSMkYK4 PHCgSmIjLc4GJcpAgMPOWAMWC9u8sQ3ML35xif6naNYb2BLjSHtizjPF+ZJsIAmJkArd ZcgKSqVY0VI8thAs/pmnVAzxcYXhJ5EobxI1JLAhQul0iDA8o2ufj2DT/tgH2tbeT20d 16iZ8EJEYl4rORR50APL880yrKDohYOEbyA8zz/odubKbggdoeA/Kcgc7JVmxeXCwn53 FuNB17xy4PkAQGSLbryu+QVkpzyE4BwjuUIcIzzgaFs+SG0YKwLkNml3v242ist2kUb8 +njg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720052703; x=1720657503; h=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=WWSfQHwTSmbCvLiObSO+1gqU+AxGW0kNmjDcdRw7nhc=; b=mYr3FxfKYaoYewhEv1ji4wETKHpdXby/tvN+NPZnvjBoJ0oDXblCcG+IQnNhk+oH8s o1+3IqO5LeH08qSm+Tk8WFOIod4AZOG59vjwfrwfv/dVfgfplRjOBeMmcp8NCP2hLPub QI6HAfXGqRD723jfLBSraQPpyd0/GBW9IYX45VLb0Qr3DNz2MEofdmKr1tvPzGB9adEz o8aaYuJv1M+lHILk1BuU5FnfHc1hwo3skhRDP5ikMvLTPUlLErBqQK4XqOKHO2EFpKzS 6MCFflirgpzn8mT40+9RohMomm0VJT5uOr1IkIKBFJbAJ3+PDCH05SQVT305nntVwdXd dn7g== X-Gm-Message-State: AOJu0YyhbjaKeNfx1NbpyfL+TV+K4Ui8b97T58/oJ2rj3joPSyf3BHBk sRxgAVEN+bZnif6AWmaKi+lTdT/3nQUY7ImDntNv98ibPGVkUK+28H+HgyFynE+v45uJjpOUG/e AR5QL4nbCVffhwI1/eE9XBykv1I95Uw== X-Google-Smtp-Source: AGHT+IEAlWPatHR9qxxzoBavR0TFVmkr5wnkMI2uxr/azC+wu0OGOgpzd5PZenqUqX/w+R4roYmxDamVevJiK3tMhOw= X-Received: by 2002:ad4:5bc3:0:b0:6b5:e7e5:e62d with SMTP id 6a1803df08f44-6b5ed09c46dmr1002386d6.43.1720052703153; Wed, 03 Jul 2024 17:25:03 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <09559430-4477-4516-8D78-6F4071E1AA6C@newclarity.net> <0182F3D6-F464-477F-9029-A2D0A8B50C71@koalephant.com> <86A83E30-00CE-434F-B316-EB9A55F92BDD@newclarity.net> In-Reply-To: <86A83E30-00CE-434F-B316-EB9A55F92BDD@newclarity.net> Date: Wed, 3 Jul 2024 20:24:51 -0400 Message-ID: Subject: Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript) To: PHP internals Content-Type: multipart/alternative; boundary="0000000000005dd716061c60fa62" From: tendoaki@gmail.com (Michael Morris) --0000000000005dd716061c60fa62 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jul 3, 2024 at 7:52=E2=80=AFPM Mike Schinkel = wrote: > Me personally, the opinions that I do not like are the one-symbol-per fil= e > assumption, which is also a key issue I have with PSR-4. > That's a PSR-4 issue, not an autoloader one. Autoloaders, even in composer, can use class maps to discover which file must be loaded to make the symbol accessible, even if multiple unused symbols in that file come along for the ride. > Understanding that the thread has been a brainstorming thread more than a > proposal thread =E2=80=94 ignoring whether or not it is effective to brai= nstorm on > this list because of interpersonal list dynamics =E2=80=94 my two cents i= n answer > to the question of *"What problem(s) are we trying to solve?"* > Brainstorming in a large group is difficult, but not impossible. The last time I tried something like this I did succeed - it was the introduction of runtime assertion to Drupal back in version 8. It took 6 MONTHS of work and debate to get that one accepted, but it has paid off well. If this goes on for a year I wouldn't be surprised. I'm fully prepared for the blind alleys and wrong turns ahead. > > 1. *Side-by-side symbol loading* =E2=80=94 PHP currently makes it difficu= lt if > not impossible to use different versions of the same library as > dependencies of higher-level dependencies. > > 2. *Symbol encapsulation* =E2=80=94 Allowing symbols to be hidden from co= de that > should not use them. > Uhm, I'm not formally trained so that one got by me - could you please give an example of this? I might have posted one already without realizing it. > > 3. *Multiple symbols per file* =E2=80=94 Finding an approach that would b= e able > to gain wide adoption for multiple symbols per file=E2=80=94 without effe= ctively > requiring an app to load all source on each page load =E2=80=94 *to bette= r > support locality of behavior.* > > See: https://htmx.org/essays/locality-of-behaviour/ > > 4. *Unified loading* =E2=80=94 Currently constants, variables, functions,= are the > have-nots of the autoloading realm. Providing a manner for loading them, > and a unified manner across all symbols would be even better. > > 5. *Community buy-in* =E2=80=94 While not a goal in and of itself, ideall= y there > would be a solution that would gain broad support over time so the approa= ch > does not get dismissed by the majority of developers simply for reasons > such as it is not what they are already familiar with. Having official PH= P > endorsement would go a long way to address this. > This last one is essential because something as core to the language must be popular. --0000000000005dd716061c60fa62 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Jul 3, 2024 at 7:52=E2=80=AFP= M Mike Schinkel <mike@newclarity.= net> wrote:
<= div style=3D"overflow-wrap: break-word;">
Me personally, the opini= ons that I do not like are the one-symbol-per file assumption, which is als= o a key issue I have with PSR-4.=C2=A0
<= br>
That's a PSR-4 issue, not an autoloader one. Autoloaders,= even in composer, can use class maps to discover which file must be loaded= to make the symbol accessible, even if multiple unused symbols in that fil= e come along for the ride.
=C2=A0
Understanding that the thread has been a brainstorming thread more than a = proposal thread =E2=80=94 ignoring whether or not it is effective to brains= torm on this list because of interpersonal list dynamics =E2=80=94 my two c= ents in answer to the question of=C2=A0"What problem(s) are we tryi= ng to solve?"

Br= ainstorming in a large group is difficult, but not impossible. The last tim= e I tried something like this I did succeed - it was the introduction of ru= ntime assertion to Drupal back in version 8.=C2=A0 It took 6 MONTHS of work= and debate to get that one accepted, but it has paid off well.=C2=A0 If th= is goes on for a year I wouldn't be surprised.=C2=A0 I'm fully prep= ared for the blind alleys and wrong turns ahead.
=C2=A0

1.=C2=A0Side-by-side symbol loadin= g=C2=A0=E2=80=94 PHP currently makes it difficult if not impossible to = use different versions of the same library as dependencies of higher-level = dependencies.

2.=C2=A0Symbol encapsulation= =C2=A0=E2=80=94 Allowing symbols to be hidden from code that should not use= them.

Uhm, I'm not f= ormally trained so that one got by me - could you please give an example of= this? I might have posted one already without realizing it.
=C2= =A0

3.=C2=A0Multiple symb= ols per file=C2=A0=E2=80=94 Finding an approach that would be able to g= ain wide adoption for multiple symbols per file=E2=80=94 without effectivel= y requiring an app to load all source on each page load =E2=80=94 to bet= ter support locality of behavior.

=

4.=C2=A0Unified loading=C2=A0=E2=80=94 Currently= constants, variables, functions, are the have-nots of the autoloading real= m. Providing a manner for loading them, and a unified manner across all sym= bols would be even better.

5.=C2=A0Community bu= y-in=C2=A0=E2=80=94 While not a goal in and of itself, ideally there wo= uld be a solution that would gain broad support over time so the approach d= oes not get dismissed by the majority of developers simply for reasons such= as it is not what they are already familiar with. Having official PHP endo= rsement would go a long way to address this.
<= br>
This last one is essential because something as core to the l= anguage must be popular.

=C2=A0
--0000000000005dd716061c60fa62--