Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127693 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 233531A00BC for ; Mon, 16 Jun 2025 19:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1750101028; bh=GF88v4Is+aNI/7do2q2si2oVo0oLHBDMYQ8pYMY9jZI=; h=Date:From:To:In-Reply-To:References:Subject:From; b=UxAs3bCRye+POJsiHL9UyfMXTcauwjZvaHax2naHEFSeMbgCuSEUVMxPEafNUYK9p zTv/kTz5kwdMAUAPYK+WOuEkScrDr/m4CeA/6bI0b0RdAzJYt2Y3zcdhqMeAeitZ4x xHTEBQnPJkpkjZ8Em05Dus/pqhFMR647iVSiKA1GuL2/ekYzxzHjiEh4JFGpy5YaHx UVgfSj8KkW8340/+BIaZyMDCUCm7P4/9D46VV2AUXsf4RzfgOKeuGDOuWp2sdtRyHO 0QsfL0fmxnuJVuz7TyY1JwyXTKEoHLmI+23H2D1MS23K8uDgekEKJy+YoY4Ld6TMJa kXcI9s6y0gtkQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 31662180059 for ; Mon, 16 Jun 2025 19:10:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_40,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.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh-a2-smtp.messagingengine.com (fhigh-a2-smtp.messagingengine.com [103.168.172.153]) (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 ; Mon, 16 Jun 2025 19:10:27 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3930C11400CC for ; Mon, 16 Jun 2025 15:12:26 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Mon, 16 Jun 2025 15:12:26 -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=fm1; t=1750101146; x=1750187546; bh=gDTSK5jp0qkTrpjWa22mM KfWin0XxBOq+vjODqCA2BU=; b=CV2Vlmbv8nOM+Wd3XIHJxnzF7xI6qkMnjhd/I +OKpTqSVQz/1YJhET+LcX6ur9aog9ujr6Wvk/uqBo6dp//LFbJcsfePccMU5VEx/ pCLeaF1y5tV6waHqWAG7uCqwoIzrRvmjp3uwFLIKWfaguc67t/plfUZ2YjbFoQYu E5sICD2SuNQEyLZJNF5Nnu1VFi3xmzcjilBH+GJzFpZVnxpzD3gdD6Q1eyAqMoqJ 4B3/imdhYvHFpiT4rZJqbwd8FxzRU+QcmTZabNmcZssooOSaFyHkO/fAQqfWeUCC 3oEL4mHgx1uyzqj2LqUIlXZBrrAkX6diA+pgfcJVUEJlrENNA== 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=fm1; t=1750101146; x=1750187546; bh=g DTSK5jp0qkTrpjWa22mMKfWin0XxBOq+vjODqCA2BU=; b=jdJOmcI3XjfonvYgr qsKz54gVsOhNZW2VZfCo65RPClUo96de5OmGiXm6lUTwhlZkE5idnSnThBalxAtB S78/4kw6MBDiFIh+LnffX3s6pN6Xg9c09Vqfc0H4dzIgFANOwFd1ljz4K6RpKY2V dRnmQ1aVusoid7hb/aYO2q+fURPgDfb4lbWkYcs6BEBDqKc7DzCaKmxOp9zxkugy h4GNwiDkIKduUUwzdK/uqs9ex/OXU4EzurHle8J3ChpepuGGSxGe3ipuOK3fyns8 3IRud+q45wSaxFN4Ovd3Ia6qi9VzKe5dSc0jJSaMm8Z2fhGzn8Blggy3dY3R2bMJ cYeGQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugddvjeeflecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvkfgjfhfutgfgsehtqhertdertdej necuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfh hivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhepffeiiedvhfdvgedutddt geetieeugeevhfetheeffeefteduiedthedtgeejueeinecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgv tghhrdgtohhmpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtph htthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id B5A69700064; Mon, 16 Jun 2025 15:12:25 -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: Tef5e70fe47074c41 Date: Mon, 16 Jun 2025 14:12:05 -0500 To: "php internals" Message-ID: <323c2a5d-d7a1-4b4e-831e-017b61e2b680@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] RFC Discussion - CLI-Only Development Mode and AOT Compilation Architecture Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Mon, Jun 16, 2025, at 2:05 AM, wheakerd wrote: > Dear PHP Internals, > > I am submitting this proposal for discussion regarding a potential=20 > future direction for PHP: moving toward a CLI-only development model=20 > and introducing an optional Ahead-of-Time (AOT) compilation=20 > infrastructure. > All of this reflects a growing shift: **PHP is increasingly behaving=20 > like a static backend language**, except it still runs on a dynamic=20 > interpreter. > > This proposal attempts to provide native language support and compiler=20 > infrastructure that aligns with these modern PHP usage patterns. This is true to an extent. Certainly there are ample places where the e= ngine could be simplified or performance improved if we had a whole-app = view at compile time. But that is a vastly different language than what= we have today. About 80% of the benefit you seek can be had today with FrankenPHP in wo= rker mode Most code works, but it retains a persistent process. That m= akes all of the compiled graphs and such in-memory, which is exactly wha= t a persistent process compiled system would give you. And ReactPHP has= been around since 5.4 or something, offering a persistent process with = the same benefit (and the same tradeoffs). > ### 3. CLI-Only Development Focus > - CLI becomes the canonical platform for PHP execution and development. > - PHP-FPM and SAPI models remain available for backward compatibility=20 > but are **not required** for future application delivery. > - Built-in CLI runners or Web adapters (e.g., `php serve`, Swoole=20 > adapters) provide development/testing environments. PHP-FPM and mod_php run 70%+ of the Internet. Deprecating them is not e= ven remotely on the table until/unless other options like FrankenPHP bec= ome standard practice across the board, including in WordPress. Which m= eans about 20 years, if we're optimistic and push hard on it. > =3D=3D=3D=3D=3D Compatibility Note =3D=3D=3D=3D=3D > This proposal is entirely opt-in and defines a **strict static subset=20 > of PHP**. Dynamic runtime via Zend VM and JIT continues to be supporte= d=20 > and unchanged. This is an addition, not a replacement. That doesn't jive with what you had above about dropping PHP-FPM. > =3D=3D=3D=3D=3D Request for Feedback =3D=3D=3D=3D=3D > I=E2=80=99d appreciate feedback from internals and community members o= n: > > - Whether such a compiler pipeline is desirable and feasible. > - Acceptability of the required language subset restrictions. > - Pathways to prototype this outside core, e.g., via PHP extensions or=20 > userland tooling. > > =3D=3D=3D=3D=3D Note =3D=3D=3D=3D=3D > I would like to clarify that I am currently not in a position to=20 > implement this proposal independently, as it would involve deep=20 > modifications to the PHP runtime, compiler pipeline design, or=20 > extension interfaces. > > This RFC is submitted with the intention of initiating structured=20 > discussion and community exploration around this long-term direction. = I=20 > am willing to contribute research, coordination, and specification wor= k=20 > if there is interest from core contributors. > > I greatly appreciate any feedback, suggestions, or interest in=20 > collaborating on prototyping or feasibility assessment. > > Sincerely,=20 > [wheakerd] As Tim said, I think you vastly under-estimate the amount of effort you = describe, even ignoring the massive existing ecosystem. You're talking = many years of work. Using FrankenPHP worker mode or one of the Fibers-based frameworks (Reac= tPHP, AmPHP, Revolt, etc.) will give you 80% of what you're looking for = or better, today. Talking about anything even more drastic is severely = premature until that model achieves critical mass, and ideally becomes t= he most widely used SAPI. Until then, this sort of "change the world" r= edesign is not feasible. --Larry Garfield