Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123978 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 DDDAD1A009C for ; Thu, 27 Jun 2024 22:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719528176; bh=8JTZ1/S9YBHWpwnhKDlqrpAHks+O6sZZ4GZWbD8ehPo=; h=In-Reply-To:References:Date:From:To:Subject:From; b=cakL0dGWITBjuOYAok2tBbrHbXvgBdNZueMt6P4L+WRWQXL8+LvvKs1265XYi3GEH Y2PSWJHnwsieVa6Wj94RNq1ATFxlQMmKriBYrPm+WrPm7yOTrW9mAbVa8Uy1fBlVpl HlsnQBByYw2D7DmeWc7WWOUKcSjIpg/k1OaAt9xw/m8iDQkUccxarYgGdVDaIO/eqP EU/Ipp/uxUc6qWLOQ2XGK5RKAZwbnRqi4PqNlaqpot6CGJnuQOln23/9PysOgqa0RX 3V4uoky0Jl5EAF2K2/0v4Gl1RcfzjBnmEzhhYRQx596Py/+HjAXeWN9StQWl6U1W6y JVGbsm1TGW+1w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2B1DD1814D2 for ; Thu, 27 Jun 2024 22:42:55 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE,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 fhigh1-smtp.messagingengine.com (fhigh1-smtp.messagingengine.com [103.168.172.152]) (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, 27 Jun 2024 22:42:54 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 37A741140087 for ; Thu, 27 Jun 2024 18:41:36 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Thu, 27 Jun 2024 18:41:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1719528096; x= 1719614496; bh=3RowQHghAtuQabgkaop3ZHOUWSQTMp62XyGqGtQ+dus=; b=A jUMVa7ZgrUU3OJmkB6EiA7NI30GWrHjFJCHQ7fqoI7eOsL40vus4zk7jMmHUopiT gIsYj30YNBp+qjwRXLKDaLlSmRAEjnqZYIdTAUHQpSRVSXtI66gRO7psa8TzAN8K OBVG/tLvHngI4UKIAwB2kwmD8Bb4X/QpnchZs1Hwu3BpLM7HagACx3E+lTvI4Pbp 37uYy8mAdYDS02xzWI1SF2VLaP9L8knkVgeKEi85Wr1urcK3PycFk261WCAkNelw gT1dhK/bOGlgs5csyPqe3Ft1fJoyhglI7B6mOnigMm+4WUOitIyOw0t0vi/NjOi1 C2e20CviHUBwIeFzIkv6A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1719528096; x=1719614496; bh=3RowQHghAtuQabgkaop3ZHOUWSQT Mp62XyGqGtQ+dus=; b=YhVFYENs+EBzZAZ/k61jioXjuEXMmL4x2T3YFpN44lJm 4yzdlVpgEsT8QTsUPWTzHjFnNyCZtwuaueRdJ4EC9dCfGQJs6XkfKGxg47FYzjx2 RI9BvYzlsgZYorsrG7jqiWTnGnboo4HhDb/nIAVrUqI4dOFsRGQZtOl7PW/M2WS+ azmy5RxXwZoOTlozPUq1BeXfVAA2s0dAHHTUUgMonZBFNgHXas8aVoGJ73z8QpBe ZGrYiYk4tQzL1ImzX2CGsF7AkKBGX7kvE4O7nYQJwiamjEVyDdGIqf5UopoM1D0+ rdcsTr6Fsf3TjB/675uHNMgcyPv0voEB2Zr8UzbjPw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdehgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuggftrfgrthhtvghrnhepgeelgfekudeivddvteffueejffdthfejieevhefgffek udevkedtvdelvddvffefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id DFC101700093; Thu, 27 Jun 2024 18:41:35 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-538-g1508afaa2-fm-20240616.001-g1508afaa Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <1f556e18-cefb-4a15-b96b-08118e48610c@app.fastmail.com> In-Reply-To: References: Date: Thu, 27 Jun 2024 22:41:15 +0000 To: "php internals" Subject: Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript Content-Type: text/plain From: larry@garfieldtech.com ("Larry Garfield") On Thu, Jun 27, 2024, at 2:15 AM, Michael Morris wrote: > 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. There's a lot to chew on here, and some interesting ideas. However, reading through it, there's one key question that sticks in my mind: What problem is this trying to solve? What problem would packages/modules/whatever be solving that isn't already adequately solved? There seems to be a bunch of stuff kinda-sorta being addressed in this proposal, but no clear picture of the problem being solved, and how it gets solved. Before we get anywhere close to weeds, there's high-level questions that need to be answered. Which of these are we trying to solve? (Solving all of them at once is unlikely, and some are mutually-incompatible.) 1. Adding a "strict pedantic mode" without messing with existing code? 2. Package-level visibility (public, package, protected, private)? 3. Avoid name clashes? 4. Improved information for autoloaders and preloading, possibly making class-per-file unnecessary in many cases? 5. A larger scope for the compiler to analyze in order to make optimizations? 6. Package-level declares, inherited by all files in the package? 7. Something else? We need to know exactly what we're solving for to be able to determine if a proposal is any good at solving it. For me personally, 2 and 4 would be the main things to address, and if someone with more compiler knowledge than me could do something on 5, that would be neat. 3 is, as Tim noted, a solved problem at this point. 1 we already are working on in stages via deprecations. 6 is potentially unwise, unless we had a good set of things that made sense to specify at a package level. Once we know what we're trying to solve, we need to ask about constraints. The major one being the relationship with namespaces. Do we want: 1. Packages and namespaces are synonymous? (This is roughly how JVM languages work, I believe.) 2. Packages and files are synonymous? (This is how Python and Javascript work.) 3. All packages correspond to a namespace, but not all namespaces are a package? And given the near-universality of PSR-4 file structure, what impact would each of those have in practice? (Even if packages open up some new autoloading options and FIG publishes a new PSR for how to use them, there's only a billion or so PSR-4 class files in the wild that aren't going away any time soon.) My gut feeling is we want 3, but I'm sure there's a debate to be had there. All the other stuff about different operators and file name extensions and stuff is completely irrelevant until there is a solid consensus on these basic questions. For something of this scale, to coin a phrase, "bring me problems, not solutions." --Larry Garfield