Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127284 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 lists.php.net (Postfix) with ESMTPS id 7D9FC1A00BC for ; Sun, 4 May 2025 21:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1746393424; bh=+viKltBGWbqbJz9spIDE2sUzAetyxlVYSk9thbpKMe4=; h=Date:From:To:In-Reply-To:References:Subject:From; b=IjZMqtVQEn7jmjzK+1IB1UaZJg1UzMdnljifFlSob1d4kmJcvVQit8/jD8h55m7Xu Aqz0m+BaD1BVKXxi5JRI/CN4vKSJKY5PeN/tre3RAcjsXT5ywCMnlaSFFzQLZ+iSCx aLE/CTtEff4T0EtEJkGfgRyQcGecyzvAleHCQjrNHREJYQHlZ+i6JqesEtBdY5ieki odsItRnn5Ng18fWbEiDmS4xKsu82gFCw52TMkAzKEhEkjtPN1T1HVlWHOl+ZZD/rXc K/glBDK3cwh6mXrGDvTS0c97cTBjKD0CVOZip4EbW/P8LmjR3wSiIHYgBYgsXXuJiA SWeczAA/z0qcg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9BE66180041 for ; Sun, 4 May 2025 21:17:02 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE 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 fout-a2-smtp.messagingengine.com (fout-a2-smtp.messagingengine.com [103.168.172.145]) (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 ; Sun, 4 May 2025 21:17:02 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 99F4113801BB for ; Sun, 4 May 2025 17:19:16 -0400 (EDT) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-10.internal (MEProxy); Sun, 04 May 2025 17:19:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding: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=fm3; t=1746393556; x=1746479956; bh=Msmk33nA8Efv86hb9hQKq KBgrz9bxGgKrO/Oy5Xq6L4=; b=HWT8VgmlfZO270bXY7/wIvKBenr9ulBXMW4TZ sA3vLHtIL93sJ6Ks0fZPM1sd9ogjfrz3iBFFI04LfhfTUjqxbO+awbxrPJU3mieH 3ho6mmb/vDIYz8JTc8a8TlqC/KyBSk91n+YwZaXCMzSv9ReOcapqGoQQbI5xVS79 LxlAdmxf+wSU1F75ljK5rfSVzFxZzLZusWcDdaWqnBVHsw32fNJ8cz8dVz/SVgcI JbvNZKYyZLWPsL9ny/I/ylgs/yreeTLzUtF4EhpXNauTbU+v+9Ma3KBV030jTOO1 wfUoU8H8u5XutLjafYwJPUVigNpmiZyC8iXkx2L+6x8CQjCDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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-sender :x-me-sender:x-sasl-enc; s=fm3; t=1746393556; x=1746479956; bh=M smk33nA8Efv86hb9hQKqKBgrz9bxGgKrO/Oy5Xq6L4=; b=fs5M3wXVZ3p/WyNiy yRR/LzLfC+zKG5P4XSuitKDZXZfm27LSXaX8NoB2P5Om8ZAy1uYVpClHUSL/heR7 dXNAHQdHT6745I+BcSiN7uLqFs86kdpHSoVcwx3chal22zG4JIunAqiZ8M66Bcfh aa4Yk24ARCX+vC1wC6ThdxYgSo9/xwFw6MYgOLQmE3KC8bW9tB5QVcQ9s5gYvnh+ BIgdOYsbWAu2owhi5iHzDAlZqIlQf3xEFzltjyE4/WhUBGCEY7tlUzXA+/n3Phz/ bIWjihAQF7HnGEJIVlUCmbCgZd9daG6UULG5qzBTGimQefxxyGimJNVBo4kkZLIJ jU/ng== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvjeelvdejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthejredtredt tdenucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrh hfihgvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpefgteffueduudeiuddv ffeiuddtudehfeegjefhheeliefhieelvdegjeeggfehheenucffohhmrghinhepghhith hhuhgsrdgtohhmpdhsphgvtgdqsghrrghinhhsthhorhhmrdhmugenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivg hlughtvggthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhht pdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 4926929C0072; Sun, 4 May 2025 17:19:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T2a4bd2276428daf8 Date: Sun, 04 May 2025 16:18:56 -0500 To: "php internals" Message-ID: <9cbbe803-5fd1-4011-b42e-033d4ede3fe9@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] Modules, again. Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Sun, May 4, 2025, at 2:34 AM, Michael Morris wrote: > It's been 9 months. Been researching, working on other projects, > mulling over > points raised the last time I brought this up. And at the moment I > don't think > PHP 8.5 is in its final weeks so this isn't a distraction for that. > The > previous discussion got seriously, seriously derailed and I got lost > even though > I started it. I'm not going to ask anyone to dig into the archives, > let's just > start afresh. This proposal requires: 1. Every module author to change their coding structure 2. Every consumer of a package to change their coding structure 3. Devs to abandon "it just works" autoloading and explicitly import packages. 4. Abandoning 16 years of PSR-0/4 file convention in favor of "module = file", which will almost certainly result in multi-thousand-line files even for clean, well-factored code. As I stated in the previous thread, this is a total nonstarter. Python/Javascript style module definition is simply not compatible with PHP. It may have been had we gone that way in 2005, but we didn't, and that ship has long since sailed. Any module proposal worth considering can require only the first point above. Requiring work from a package author to module-ify their code is fine, though it shouldn't be onerous. But it needs to "just work" with the rest of the existing ecosystem. This proposal fails at that. Arnaud and I spent some time last year exploring a different approach to modules that requires only trivial changes by package authors, and none by consumers: https://github.com/Crell/php-rfcs/blob/master/modules/spec-brainstorm.md https://github.com/arnaud-lb/php-src/pull/10 In our case, the main target was performance by giving the opcache optimizer a larger chunk of code to work with, plus the potential for namespace-private symbols. Arnaud was able to make it mostly work, and there was significant potential performance to be had, but it also ran into some very complex issues very quickly. (Circular dependencies, modules split across multiple directories, testing, etc.) We largely haven't gotten back to it as the implementation was very complex and it wasn't clear if the benefit would be worth it, though I'd still like to revisit it if possible. --Larry Garfield