Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124060 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 37EBD1A009C for ; Sat, 29 Jun 2024 20:20:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719692518; bh=jwLgSrOSEuA8MpYX7+vsSIxazNfnR9sIgcbHvD/DwIU=; h=References:In-Reply-To:From:Date:Subject:To:From; b=GJr8Dhlm5am0HO0WxmP3fiAdiHp/SalsJ27uELinjpACKrXY3L2UWz9Q48IPPMXTx DdGwuX2yNYCTGRXLBLNazb73Fbi0gMayqGoVdG6Tnod6oWdHHCO4g6WffQ7Oh0GjNG ObO+PrBQGpIXJKUxi/wD8fqHBPbx2b8cDk7idB3WrLIJFfM5/+mEOePGNfWf2J4Jd6 OxwbwLRihdVBEctfxkOag5mVsPcoXq6kBL92afsV3H7kykJEttu4MqMskbzAEYmSs3 dlhGLEeokOtc/EmjRg5HdXpX1BURoom1IKvwkaglPeVovDQehDCJUrz+zgm+OhfEOY QVbEi1N6nzCMw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3C0C81806C4 for ; Sat, 29 Jun 2024 20:21: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=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-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (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 ; Sat, 29 Jun 2024 20:21:56 +0000 (UTC) Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-6b5052defa6so10254546d6.3 for ; Sat, 29 Jun 2024 13:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719692436; x=1720297236; 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=moc7fvpuMwzK2PLBcfiHMKa8FUeckBUPHvO0OZtHOTQ=; b=Z04zY8p3CsJakpNT6KNbh6XUTqu7OgVJnpklY7GnpSi5piIPPl8k0uw9dPFStqSNnH jtHP5etsHxnpChYjXi7EqJNoU29UgCepKjYrrG7OpZzrY0pCjRh9lzrmUp831XUB7KZK 5KBc43a+x8Tc35VLONatMl9vLycsZRD12RW4hyk6IJLQMWF9fQ/rBunN1CG1btsHCBLH xfb1+Vi4k6EmCQ8NDvr249vadL7sX3a3YhS7w9vGksUqeJf5pUNeKAEhiqNZzRB5kNPI ylnW3MBRFIhb+c3XQ4pd157YOmbzipbtpELIWzj2Bpp22byxTmXmcQJWZt9P9RMrJcfv yw6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719692436; x=1720297236; 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=moc7fvpuMwzK2PLBcfiHMKa8FUeckBUPHvO0OZtHOTQ=; b=wIYzOMweiV0uJqfeM0BRQvy0P25DgM/6/cZbDB1l8DvyoS+EdRF8t+VyrLXh7505Ni d/JBKot3WQp9M1G3iJS0XwtzgRvjyCBnkzHGmyQ5ghIABd9afny5YkFtlGsMeX3w/n5R bu5jeMacZxzrxPRG4VgjWi0XqhI8ExWK/L66Tkd1Xfi4+hZiDXWaHPV1YBPuYPabHRF+ tdiX5FWNYkBB75nk+29CcPyQeRrX5xRhkrwrk+BZu9wbqnZtEgnSbk9+vyAgRQLjcEY/ QfrnGhESkd69Jo//ktLPkjyDm6v4Xabe+Sx96k1Nr13ovSYI8dPenMk32z++yQweUImO 498w== X-Gm-Message-State: AOJu0Yzb9PT3Em9Zq3s1+l0SbnUgY4EA6ie+lOogn+NvBlGRmlxjih1w umFZzTFMnNT9e2NTj054vLzNUZgGJmBugfGH68U6PG1z/PYyw9l7ce/GCpDsYDLcsPyFkPybi+h LmXdQieaZ65JIgqfT4fJf675Pt3lvs9bQ X-Google-Smtp-Source: AGHT+IHVhnPNUUCAI2gWA+5OCe+ASbDkrR0kpSqYoPxhFPzTd/MHPylRc0tVyA4+PGYxQtcZyco7inBL6qM2lABDNXg= X-Received: by 2002:a05:6214:d84:b0:6b5:149:eac5 with SMTP id 6a1803df08f44-6b5b709cc5fmr22230626d6.15.1719692436298; Sat, 29 Jun 2024 13:20:36 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 29 Jun 2024 16:20:23 -0400 Message-ID: Subject: Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript To: PHP internals Content-Type: multipart/alternative; boundary="000000000000c9e585061c0d183c" From: tendoaki@gmail.com (Michael Morris) --000000000000c9e585061c0d183c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jun 29, 2024 at 2:20=E2=80=AFPM David Gebler wrote: > On Thu, Jun 27, 2024 at 4:33=E2=80=AFAM Michael Morris wrote: > >> Hello all. This is a ramble of an idea that's managed to run around my >> head for a few days now. It isn't fully formed, but I've ran the thought >> experiment as far as I can on my own and want to share it with all of yo= u. >> >> If you got this far, thank you. This overall idea to take one of the >> better things to happen to JavaScript in the last decade and incorporate= it >> into PHP has been bothering me for awhile so I figured I'd share. I don= 't >> know how much merit there is to this though. >> > > I don't think PHP needs to take many if any lessons from JS to be honest. > JS evolved the way it did to solve its own set of problems, and likewise = so > has PHP. I'm not really clear from reading the whole thing what problems > this loose bag of ideas is even intended to solve, really, but from what = I > have gathered it seems to me more like what you want is a transpiler a la > Typescript and that this would achieve whatever you're trying to achieve. > Personal take, but if there's one thing I don't want for PHP it's to beco= me > [any more] of a garbled mess of different styles and different ways of > achieving the same fundamental abstractions and results. Composer and PSR= -4 > have become de facto standards, they're very good standards, we've achiev= ed > remarkable near unity in their adoption and whatever few inconveniences > remain through the application of those standards in certain cases are > minor trade-offs (not having multiple interfaces in the same file, etc.) > Near universal unity?? You're forgetting Wordpress, which has massive PHP market share (more than 50% of PHP backed websites - well more than depending on which survey you cite) and DOES NOT USE COMPOSER. And it DOES NOT USE PSR-4 either. Composer is wonderful as a userland solution to a problem the Internals team has failed to solve, but such a critical problem as package management being mostly solved in userland using a configuration file (composer.json) written in another programming language entirely is frankly an embarrassment in my opinion. > A JS-inspired subset of PHP within PHP, supported by invocation through > new keywords and handed off to a separate parser seems like it's asking f= or > trouble at every level from implementation to maintenance to userland to > dependency management... > What is asking for more trouble is to stagnate, sit-on-hands, and twenty years from now PHP will be where COBOL is today - a niche programming language that was once widely used, but reviled, hated, and the current generation of programmers working feverishly to remove it entirely. Not to mention the butt of an awful lot of jokes. No one is going to post to this list with a perfect plan to solve package management in CORE. Not in userland - we've got that - in CORE. That is a feature PHP lacks that is present in Java, NodeJS (not clientside JS, a distinction needs to be made), C#, Python and Go (likely others, but those are the ones I've used and whose implementations I am familiar with on at least a cursory level.) And yes, JavaScript has a carnival of problems. Most of those problems do not apply to PHP. But I'm starting from there because that's what I would expect the majority of the PHP community to be familiar with - especially when you include the large forgotten WordPress legion who don't have a clue what your beloved composer is. And I also don't appreciate the notion that any solution proposed here should be 100% perfect and ready for implementation day one. That's never going to happen. But I'm not willing to join several talented programmers that have spent a month to a year getting a working implementation into place before submitting an RFC only to have it shot down after work has been done. Cause frankly, I think some of y'all are only here to shoot ideas down and never come up with new ones. And while I'm no expert on the underlying engine there are problems with it that have risen to the surface that may never be solvable except to move to a subset language. Like, why in Hell does PHP need THREE scope resolution operators when every other damn programming language I've ever seen gets by with ONE. And then there's having variables be required to have a $ prefix and exist on their own symbol table unaffected by namespace. And I could go on from there, but I don't want to belabor such points like the haters of the language do because I am willing to live with them if they must be there. I want to improve things if I can though. Some of you just want to furiously defend the status quo with religious zeal. And that is not helpful. That just drives people off. --000000000000c9e585061c0d183c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Sat, Jun 29, 2024 a= t 2:20=E2=80=AFPM David Gebler <davidgebler@gmail.com> wrote:
O= n Thu, Jun 27, 2024 at 4:33=E2=80=AFAM Michael Morris <tendoaki@gmail.com> wrote:
Hello all. This is a ramble of an idea that'= ;s managed to run around my head for a few days now. It isn't fully for= med, but I've ran the thought experiment as far as I can on my own and = want to share it with all of you.

If you got this far, t= hank you. This overall idea to take one of the better things to happen to J= avaScript in the last decade and incorporate it into PHP has been bothering= me for awhile so I figured I'd share.=C2=A0 I don't know how much = merit there is to this though.

= I don't think PHP needs to take many if any lessons from JS to be hones= t. JS evolved the way it did to solve its own set of problems, and likewise= so has PHP. I'm not really clear from reading the whole thing what pro= blems this loose bag of ideas is even intended to solve, really, but from w= hat I have gathered it seems to me more like what you want is a transpiler = a la Typescript and that this would achieve whatever you're trying to a= chieve. Personal take, but if there's one thing I don't want for PH= P it's to become [any more] of a garbled mess of different styles and d= ifferent ways of achieving the same fundamental abstractions and results. C= omposer and PSR-4 have become de facto standards, they're very good sta= ndards, we've achieved remarkable near unity in their adoption and what= ever few inconveniences remain through the application of those standards i= n certain cases are minor trade-offs (not having multiple interfaces in the= same file, etc.)

Near un= iversal unity??=C2=A0 You're forgetting Wordpress, which has massive PH= P market share (more than 50% of PHP backed websites - well more than depen= ding on which survey you cite) and DOES NOT USE COMPOSER. And it DOES NOT U= SE PSR-4 either.

Composer is wonderful as a userla= nd solution to a problem the Internals team has failed to solve, but such a= critical problem as package management=C2=A0being mostly solved in userlan= d using a configuration file (composer.json) written in another programming= language entirely is frankly an embarrassment in my=C2=A0opinion.


A JS-inspired subset of = PHP within PHP, supported by invocation through new keywords and handed off= to a separate parser seems like it's asking for trouble at every level= from implementation to maintenance to userland to dependency management...=

What is asking for more = trouble is to stagnate, sit-on-hands, and twenty years from now PHP will be= where COBOL is today - a niche programming language that was once widely u= sed, but reviled, hated, and the current generation of programmers working = feverishly to remove it entirely. Not to mention the butt of an awful lot o= f jokes.

No one is going to post to this list with= a perfect plan to solve package management in=C2=A0CORE.=C2=A0 =C2=A0Not i= n userland - we've got that - in CORE.=C2=A0 That is a feature PHP lack= s that is present in Java, NodeJS (not clientside=C2=A0JS, a distinction ne= eds to be made), C#, Python and Go (likely others, but those are the ones I= 've used and whose implementations=C2=A0I am familiar with on at least = a cursory level.)

And yes, JavaScript has a carniv= al of problems. Most of those problems do not apply to PHP. But I'm sta= rting from there because that's what I would expect the majority of the= PHP community to be familiar with - especially when you include the large = forgotten WordPress legion who don't have a clue what your beloved comp= oser is.

And I also don't appreciate the notio= n that any solution proposed here should be 100% perfect and ready for impl= ementation day one.=C2=A0 That's never going to happen.=C2=A0 But I'= ;m not willing to join several talented programmers that have spent a month= to a year getting a working implementation into place before submitting an= RFC only to have it shot down after work has been done.=C2=A0 Cause frankl= y, I think some of y'all are only here to shoot ideas down and never co= me up with new ones.

And while I'm no expert o= n the underlying engine there are problems with it that have risen to the s= urface that may never be solvable except to move to a subset language.=C2= =A0 Like, why in Hell does PHP need THREE scope resolution operators when e= very other damn programming language I've ever seen gets by with ONE. A= nd then there's having variables be required to have a $ prefix and exi= st on their own symbol table unaffected by namespace. And I could go on fro= m there, but I don't want to belabor such points like the haters of the= language do because I am willing to live with them if they must be there. = I want to improve things if I can though.

Some of = you just want to furiously defend the status quo with religious zeal. And t= hat is not helpful. That just drives people off.

<= br>
<= br>
--000000000000c9e585061c0d183c--