Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Rob Landers
On Wed, Jul 3, 2024, at 18:51, Matthew Weier O'Phinney wrote: > > > On Wed, Jul 3, 2024 at 9:50 AM Stephen Reay wrote: >> >> >>> On 3 Jul 2024, at 21:07, Vincent de Lau wrote: >>> >>> From: Stephen Reay >>> Sent: Wednesday, July 3, 2024 1:17 PM >>> On 1 Jul 2024, at 23:33, Mike Schi

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Stephen Reay
> On 3 Jul 2024, at 23:51, Matthew Weier O'Phinney > wrote: > > > > On Wed, Jul 3, 2024 at 9:50 AM Stephen Reay > wrote: >> >> >>> On 3 Jul 2024, at 21:07, Vincent de Lau >> > wrote: >>> >>> From: Stephen Reay >>

Re: [PHP-DEV] [PHP-Dev] Versioned Packagers (Iteration IV)

2024-07-03 Thread Mike Schinkel
> On Jul 3, 2024, at 10:31 PM, Michael Morris wrote: > > On Wed, Jul 3, 2024 at 9:56 PM Mike Schinkel wrote: > > There are ~6300 uses of the keyword `import` on GitHub: > > https://github.com/search?q=import+language%3APHP+symbol%3A%2F%5Eimport%24%2F&type=code > > That's a lot of BC breakag

Re: [PHP-DEV] [PHP-Dev] Versioned Packagers (Iteration IV)

2024-07-03 Thread Michael Morris
On Wed, Jul 3, 2024 at 9:56 PM Mike Schinkel wrote: > > There are ~6300 uses of the keyword `import` on GitHub: > > > https://github.com/search?q=import+language%3APHP+symbol%3A%2F%5Eimport%24%2F&type=code > > > That'

Re: [PHP-DEV] [PHP-Dev] Versioned Packagers (Iteration IV)

2024-07-03 Thread Mike Schinkel
> On Jul 3, 2024, at 8:16 PM, Michael Morris wrote: > Can PHP support multiple packages without rewriting the whole engine? I > think so, but it isn't trivial, and the side effects need to be cordoned off > so that those who need this complexity can have it while the beginning and > intermedia

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Mike Schinkel
> On Jul 3, 2024, at 8:24 PM, Michael Morris wrote: > On Wed, Jul 3, 2024 at 7:52 PM Mike Schinkel > wrote: > Me personally, the opinions that I do not like are the one-symbol-per file > assumption, which is also a key issue I have with PSR-4. > > That's a PSR-4 iss

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Michael Morris
On Wed, Jul 3, 2024 at 7:52 PM Mike Schinkel wrote: > Me personally, the opinions that I do not like are the one-symbol-per file > 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

[PHP-DEV] [PHP-Dev] Versioned Packagers (Iteration IV)

2024-07-03 Thread Michael Morris
Hello all. Hitting reset again as the primary problem at hand has become clear. Let's recap it. Autoloading is great for loading packages, but it can't load different versions of the same package at the same time. Why would you want to do that? When you don't have full control of the code. For

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Mike Schinkel
> On Jul 3, 2024, at 7:17 AM, Stephen Reay wrote: > > Sent from my iPhone > >> On 1 Jul 2024, at 23:33, Mike Schinkel wrote: >> >> Autoloading runs userland code. This means it has the potential conflict >> between different packages with different autoloaders > > *Can* run userland code. It

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Michael Morris
On Wed, Jul 3, 2024 at 1:24 PM Rob Landers wrote: > > So, if v4 has BC breaks ... how would Drupal not crash? If you allow > multiple versions, how would you use both versions? I'm not even sure that > is a logical possibility. > > Twig in Drupal will be installed the old way and find itself boun

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Rob Landers
On Wed, Jul 3, 2024, at 19:15, Michael Morris wrote: > > > On Wed, Jul 3, 2024 at 12:52 PM Matthew Weier O'Phinney > wrote: >> >> >> I'm following the packaging threads closely, and the one thing I've failed >> to see a solid argument for is _what problems_ the current approach of using >

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Michael Morris
On Wed, Jul 3, 2024 at 12:52 PM Matthew Weier O'Phinney < mweierophin...@gmail.com> wrote: > > > I'm following the packaging threads closely, and the one thing I've failed > to see a solid argument for is _what problems_ the current approach of > using namespaced code doesn't address. > Running m

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Matthew Weier O'Phinney
On Wed, Jul 3, 2024 at 9:50 AM Stephen Reay wrote: > > > On 3 Jul 2024, at 21:07, Vincent de Lau wrote: > > From: Stephen Reay > Sent: Wednesday, July 3, 2024 1:17 PM > > On 1 Jul 2024, at 23:33, Mike Schinkel wrote: > > Autoloading runs userland code. This means it

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Rob Landers
>> To come back to spl_autoload: That function pre-dates namespaces and is >> highly opinionated on how to organise code. All lower-case filenames, class >> per-file, files in include_path, full namespace in path, you name it. If >> that is what projects wanted at the time, or even now, PSR-0 a

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Stephen Reay
> On 3 Jul 2024, at 21:07, Vincent de Lau wrote: > > From: Stephen Reay > Sent: Wednesday, July 3, 2024 1:17 PM > >> On 1 Jul 2024, at 23:33, Mike Schinkel wrote: >>> Autoloading runs userland code. This means it has the potential conflict >>> between different

Re: [PHP-DEV] [RFC] Property Hook improvements

2024-07-03 Thread Rob Landers
On Wed, Jul 3, 2024, at 16:22, Rob Landers wrote: > > > On Wed, Jul 3, 2024, at 15:29, Claude Pache wrote: >> >> >>> Le 3 juil. 2024 à 14:42, Rob Landers a écrit : >>> >>> On Wed, Jul 3, 2024, at 14:28, Claude Pache wrote: > Le 3 juil. 2024 à 11:54, Claude Pache a écrit : >

Re: [PHP-DEV] [RFC] Property Hook improvements

2024-07-03 Thread Rob Landers
On Wed, Jul 3, 2024, at 15:29, Claude Pache wrote: > > >> Le 3 juil. 2024 à 14:42, Rob Landers a écrit : >> >> On Wed, Jul 3, 2024, at 14:28, Claude Pache wrote: >>> >>> Le 3 juil. 2024 à 11:54, Claude Pache a écrit : 2. As for readonly, I think that the invariant it

RE: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Vincent de Lau
From: Stephen Reay Sent: Wednesday, July 3, 2024 1:17 PM > On 1 Jul 2024, at 23:33, Mike Schinkel wrote: > > Autoloading runs userland code. This means it has the potential conflict > > between different packages with different autoloaders > *Can* run userland code

Re: [PHP-DEV] [RFC] Property Hook improvements

2024-07-03 Thread Claude Pache
> Le 3 juil. 2024 à 14:42, Rob Landers a écrit : > > On Wed, Jul 3, 2024, at 14:28, Claude Pache wrote: >> >> >>> Le 3 juil. 2024 à 11:54, Claude Pache a écrit : >>> >>> >>> 2. As for readonly, I think that the invariant it is supposed to provide >>> should be enforced as strictly as poss

Re: [PHP-DEV] Packages Iteration 3: was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript

2024-07-03 Thread Michael Morris
On Mon, Jul 1, 2024 at 1:33 AM Michał Marcin Brzuchalski < michal.brzuchal...@gmail.com> wrote: > Hi Michael, > > pon., 1 lip 2024 o 01:18 Michael Morris napisał(a): > >> ... >> Applications >> >> The application is the root package. It is the package that imports to >> the root namespace. When P

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Michael Morris
On Wed, Jul 3, 2024 at 7:49 AM Aleksander Machniak wrote: > On 3.07.2024 07:32, Richard Miles wrote: > > What if php implicitly prepended namespaces with the composer package > version? > > If two incompatible versions are required, the composer downloads both. > Enabled/Disabled with flag? > > W

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Michael Morris
On Mon, Jul 1, 2024 at 9:02 AM Larry Garfield wrote: > 2. Supporting multiple versions of the same class is *wy* out of > scope. No, it's actually the heart of the problem now that I've had a few days to think on this, and it's something an autoloader can NOT resolve. > You seem to imply

Re: [PHP-DEV] Re: [RFC] [Discussion] Fix up BCMath Number Class / Change GMP bool cast behavior

2024-07-03 Thread Saki Takamachi
> This seems positive to me. Rounding being explicit makes more sense. Thanks! Saki

Re: [PHP-DEV] [RFC] Property Hook improvements

2024-07-03 Thread Rob Landers
On Wed, Jul 3, 2024, at 14:28, Claude Pache wrote: > > >> Le 3 juil. 2024 à 11:54, Claude Pache a écrit : >> >> >> 2. As for readonly, I think that the invariant it is supposed to provide >> should be enforced as strictly as possible. It means that `readonly` is only >> acceptable if there i

Re: [PHP-DEV] [RFC] Property Hook improvements

2024-07-03 Thread Claude Pache
> Le 3 juil. 2024 à 11:54, Claude Pache a écrit : > > > 2. As for readonly, I think that the invariant it is supposed to provide > should be enforced as strictly as possible. It means that `readonly` is only > acceptable if there is no `get` hook. Hi, One more thing, why I think that we sh

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Aleksander Machniak
On 3.07.2024 07:32, Richard Miles wrote: What if php implicitly prepended namespaces with the composer package version? If two incompatible versions are required, the composer downloads both. Enabled/Disabled with flag? While we're brainstorming... What if something like this would be possible

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-07-03 Thread Stephen Reay
Sent from my iPhone > On 1 Jul 2024, at 23:33, Mike Schinkel wrote: > Autoloading runs userland code. This means it has the potential conflict > between different packages with different autoloaders *Can* run userland code. It doesn't *have to*; FYI spl_autoload (https://www.php.net/manual/e

Re: [PHP-DEV] [RFC] Property Hook improvements

2024-07-03 Thread Claude Pache
> Le 1 juil. 2024 à 19:02, Larry Garfield a écrit : > > Hi folks. As Ilija's been polishing off hooks to get the PR merged, we've > run into two small revisions that should make life better for all involved. > One is a performance improvement that requires a very slight error handling > be