Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124138 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 7E2F51A009C for ; Mon, 1 Jul 2024 13:01:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719838991; bh=JI5RD2o1Fqn4C7t8028RXrgTkmsV9lpJEahIbhkHs9E=; h=In-Reply-To:References:Date:From:To:Subject:From; b=IKdplIYYWOvzRObyxcu01V0a4s6FVFAWiJwnCDWxbk99q5vKH06xqL/H2uNh4/5GR wiEKk8uCB9iK7nz7MPABTAuxSCJY/eiTha48WS0srxxk5F8xrDy9omL08kR4fYdLhK SwKoE1Z+WfznGqmuePTqyYEqPhASLUkLXx7dxraaCTpWpt9I/4e9qebz+3F05b0mj4 KqwDFn1feF09ruVI37jRmtP31QDTV6ZIOTG6dRoGWjay7JSvvP7ImrGYI3U/T4/TB1 LFhKTzaTj39qW8WjVn0Oo3G8fnNq7jJIXpKM2lSiVI0Fv2ycXDBncbeL6gsPwPAaWQ nmI5r6tVwwRWA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 44F4C180543 for ; Mon, 1 Jul 2024 13:03:11 +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 wfhigh7-smtp.messagingengine.com (wfhigh7-smtp.messagingengine.com [64.147.123.158]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 1 Jul 2024 13:03:10 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.west.internal (Postfix) with ESMTP id 15C19180006D for ; Mon, 1 Jul 2024 09:01:49 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Mon, 01 Jul 2024 09:01:49 -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=1719838908; x= 1719925308; bh=WrW8Hn/cqAwjNFv/r2BjCq91Rgjbzquu2QeXBZPBSJ4=; b=i 744BEDquMUByvC1IRhNuWDZr4BR1eq1CPWsjVgAeooJNaYpcUpqObCVt21u4VRsA 0B1TJ9p6ho1RtCLWzx6p1Waln6JxkJIcfSemxag7DaadGG9pqgY4QOzGC/4nO8js ZACtCOS5/d/6ulCfPp/M4zhMcUw5SzxMg6Ytm9wq3oU9yTDLDhxWaHGkY5/2/Az+ Zmdpqf0si3thUUpFriV3sLu2chVPRu5hxTaYMxKoJBAuKvQgiEioqgYFyCLMXrGr 7KJDxLbLEzlxBmWpNNGO6H0IKNqxN/WwkH8hm+9VRFhvf5fxEGRaCAFB63z5XVKh ugg1sLiKcfxawiCtSG0eQ== 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=1719838908; x=1719925308; bh=WrW8Hn/cqAwjNFv/r2BjCq91Rgjb zquu2QeXBZPBSJ4=; b=Fx7ceKo2CwAYEQmVqFdM2BSnlZlAcfmAo0E4kHXNIwan uUvlNkswc53wtLo9l2kc2+cuWYRMOMWovGA6MO6EMkGp4HJKLWavjWj3tuQkZ3Ui VVC84o50MzBcNBUIp/pf+ZqkLHtcUHgz6887zQ6arcUO8jw8rX+fFyz6hh9n81dI JQtfbX7KOmIjdWcoRuOi0qpwwleS0Jvt8/dSMIgwHWKHQggqs4W9hERuc+kcXAHC WAT4Wy+37t/3qj1J6BEkoI9aus1bqUPkxqJSDFOYRIgv9kLBoTLAh7r1UKXnuJlh /UH6suk663vrvQLE2YdAdOXXPm/Kf6nPCfAt9vIT9g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudefgdehjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuggftrfgrthhtvghrnhepgeelgfekudeivddvteffueejffdthfejieevhefgffek udevkedtvdelvddvffefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2536B1700093; Mon, 1 Jul 2024 09:01:48 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-566-g3812ddbbc-fm-20240627.001-g3812ddbb Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <217db044-e356-4e18-ba68-c18dce6381a5@app.fastmail.com> In-Reply-To: References: <1917CF7C-26D8-4DBE-B05C-5AA650AC6C9F@rwec.co.uk> <551cd5b0-1c00-4818-a9ca-97f6b7e8c3dc@app.fastmail.com> <39B496F8-062E-4848-9B3B-529BE8D3415A@newclarity.net> <856F4F70-DC81-4098-82DD-5F6D47CDF3F0@newclarity.net> Date: Mon, 01 Jul 2024 13:00:21 +0000 To: "php internals" Subject: Re: [PHP-DEV] Iteration III: Packages (was 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 Sun, Jun 30, 2024, at 8:28 PM, Michael Morris wrote: > So let's take another crack at this based on all the points raised in > the thread. This should also underline why I don't consider this an RFC > - I am iterating until we arrive at something that may be refinable > into an RFC. And I say we because without the aid of those in this > conversation I would not have arrived at what will follow. > > Before I continue I would like to apologize for being somewhat > irritable. We're all here because we enjoy using this language and want > to see it improved and prevent bad changes. Opinions will differ on > this and in the heat of the moment of arguing a point things can get > borderline. > > > Returning to a point I made earlier, Composer isn't used on Wordpress. > I went over to the Wordpress discussion list and read over why, because > that discussion provides clues to what kind of package management may > be adoptable. I think the largest point is that Wordpress should be > usable without ever resorting to using the command line. Yes, it does > have a command line tool - wp-cli - and it is powerful, but using it as > an administrator of a Wordpress site is not required. > > The largest block to composer's inclusion in Wordpress is the inability > to run multiple versions of a module. Yes, it's a mess when this > happens, but if you're an end user, you just want your plugins to work. > If one plugin that no one has updated in a year that you're using is > consuming version 2 of a package, you're gonna be annoyed at best if > the module stops working when you install a new plugin that is using > version 3 of the same package and has a BC break in it. Composer can't > resolve this easily. There's still a few key, fatal issues in this version of the proposal. 1. It appears like it expects PHP to be able to write to disk itself as part of normal operation. This is an immediate fatal flaw. Most security best practices these days recommend that the disk where code is be read-only. Some hosting companies mandate it. Any language feature that precludes that is dead in the water. 2. Supporting multiple versions of the same class is *waaaay* out of scope. You seem to imply Composer is the reason we cannot do that. That's incorrect. PHP has a single global symbol table for classes. (And a separate one for functions for not-great historical reasons.) Trying to define the same class twice will fatal the engine. While there are some screwy conditional-include games you can play, they're fragile and still would not allow WP Plugin A to use v1 of a library and WP Plugin B to use v2 of a library. I am not versed in that part of the engine, but I would be shocked if splitting up the global symbol table was possible, let alone feasible. 3. Using URLs as the package naming system is the dumbest thing Go ever did. Let's not replicate that. :-) I think the core problem here is that this thread keeps trying to graft Python/Go/JS/Rust style packages onto PHP. PHP, however, is structurally closer to Java/C#, so following that package logic (which is built off of namespaces) would be far more natural, and thus far easier to migrate to. Really, the only targets we should be looking at, IMO, are: 1. Package-level visibility. 2. Giving the compiler/optimizer/JIT a larger "scope" of code to compile/optimize at once, so it can do smarter things. I think everything else is a distraction. I have some thoughts on how we can far more easily accomplish 1, and maybe 2, but I will probably hold off on that for now as it would just get lost in the noise of this thread, plus the list is too busy as is these days with everyone trying to get their in-flight RFCs finalized before the feature freeze deadline. :-) (Really, this is a poor time to be having this kind of discussion. Fall is generally the better time, just logistically.) --Larry Garfield