Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127321 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 8117A1A00BC for ; Thu, 8 May 2025 14:29:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1746714452; bh=Vex0EoyEClUgWY7+F3NoeYyyP6WIVSjjOk+SWJgtpK8=; h=Date:From:To:In-Reply-To:References:Subject:From; b=mCGLicn+CuFpBhwAruZG/raY54hbjjy7Vs0YfE1YgQIIeMSYG4psaPhTHYXJK3Sd5 G3zxb2s+ma5u9MhhAEHvx8HF12zCJl3MpsmLEO/+KkVFxh2w+mAHCM5333O3s4g7Ys RG4C/YLDN4XRo+z7pecGBGmVYTLXa2KdudJAu6CtSfY6s7qsMxd3CTg7g78I8BcVlB jBdS2/tmMqJFOqzi39vCGTmC7MYsKKNicCsSxBVryQKJQad12+3sOzctdVqRDUvLP5 4qr3TWjpjVdwx5cQYKjAEKGLci3MVC1KwXXv3I0vMsnSwbWCL2oszb+Wjyd2J4wm95 8TG5srJpHgrFA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F3DDE1801C7 for ; Thu, 8 May 2025 14:27:30 +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.9 required=5.0 tests=BAYES_20,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 fhigh-b6-smtp.messagingengine.com (fhigh-b6-smtp.messagingengine.com [202.12.124.157]) (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, 8 May 2025 14:27:30 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id 525E525401D8 for ; Thu, 8 May 2025 10:29:43 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Thu, 08 May 2025 10:29:43 -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=1746714583; x=1746800983; bh=UC2GOMNkdMrE/sCJdgrCe UJcsm1yhZJCwmxethAbPTY=; b=m5TwaFEIJCyFHuDZ9n662PhHW5/A7nzFQ+Gxq lLvBEg/f947UcGbT2HlaZDmVo4YPwY+nqlQlB7Gvk/zydBhfWX1MXxR9xjLcXaGb 3/jBORQc/obO0b/9GYkrIN7oIiHFYrVtx0+uz6Uiy27lEni1qlp7JPqMtqllYsEK m8QCWGKULLOqpLoy8YIsEDDuvV57eV6A/TQJ2QbwexzxitWaS8xKKLEv0kpe7nsh 4Ndxq/lJNx40RPb/U7BfXKKfZnGuSc+e3hKUibWdtPXCTTGaRjFkfteg0bm8vuWp qfBqpquV1JCUTdswWSAxjNCWPO95Zd95qfgBYYPCecrPTIgGQ== 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=1746714583; x=1746800983; bh=U C2GOMNkdMrE/sCJdgrCeUJcsm1yhZJCwmxethAbPTY=; b=VgP8oAKcbwa3wCZKc 8FBLJ8voR7HZgnjkVymYMhtMtBkJB5v8hRc3CZE2OcsZwbiJ9i68I0ijZalwkvLd vhILIE0Naysa6EIq05FEkOJDsmHIQ/1KA5LORPsaONOeVHNIdWWOWf/aPJOJA7r/ fwuGs6AnixfQ6GIkxUsD8CvdHn6zzRfJvz17KyW7DbHkEtGD6Kh9Vawwug1GerxW J/oE6V+9+5xP4/CZuNEI18vAxEiCz0gSwGW4D20T6RHM+sdtcq2I2+hANnxmneDb DmIXkWWdKEfcZrhF3e8AI7BG4PMniZOyev7rM5v/j4pPCwiMu6F+XKnB/3LVVJSs 6E2PQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvkeelleekucetufdoteggodetrf 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 B2D7AB0006A; Thu, 8 May 2025 10:29:42 -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: Thu, 08 May 2025 09:29:03 -0500 To: "php internals" Message-ID: <4bb46683-0653-4558-9002-1847e94f865d@app.fastmail.com> In-Reply-To: References: <6d2adbbb-f4fa-41e6-9ec1-179685ded039@rwec.co.uk> Subject: Re: [PHP-DEV] Modules, again. Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Wed, May 7, 2025, at 3:51 PM, Michael Morris wrote: >> The main exception, as you have pointed out, is plugin architectures >> like WordPress, where the plugin might want to "privately" use some >> library without impacting the host application and other plugins. > > It's not just WordPress. Drupal and other CMS's have extensions, but > their reliance on composer means abandoned plugins that need an old > library can block updating the whole system. The larger and more > popular the application is the more likely this becomes. And like it > or not WordPress haters on the board, for as much as WordPress sucks > (and I will agree, it sucks hard) it still have a 50% - 80% market > share of PHP websites depending on who you ask. A lot of this stems > from the fact that end users just want their site to work - they don't > give a rat's ass about dependencies and the like - and needing to drop > a plugin to upgrade a site will put a bad taste in their mouth at best. If we're going to cite WordPress as a design factor, then we should also recognize that WordPress has virtually no involvement in PHP Internals, and its version requirement history means that even if PHP 8.5 were to ship with the perfect multi-version-loading system, it would be around 10 years before WordPress even supported that PHP version. As a practical matter, it's just not a meaningful factor. >> I *do* think PHP would benefit from some native concept of "module" for >> other reasons, e.g. marking internal components, optimising across >> multiple files. I *do not* think that ES/JS/TS is a suitable model to >> look at, because it is starting from a fundamentally different concept >> of what a declaration is. > > So what do you suggest then? Go's model? Rusts? Gradle or Maven from > Java? Shooting down stuff is trivial, finding solutions is the real > work. Quoting from my first post in this thread: > 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. I don't believe that is a perfect proposal, but it is a different approach that Arnaud's experimentation shows has the potential for as much as a 20% performance improvement in some situations. That's nothing to sneeze at. There's still challenges with it, both implementation and DX, but let's not pretend that aping Python is the only option that exists. I believe that qualifies as "real work." --Larry Garfield