Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123975 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 573D21ADA72 for ; Thu, 27 Jun 2024 22:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719525719; bh=fRSXX8veYHnu3VdsotEZlY07keWrQvoI5iVaXP56sMM=; h=Date:Subject:To:References:From:In-Reply-To:From; b=HWWkpF3PmqIzGeWgeLcqIu1s0CbdslCHMM2cfNNGHghjC2xDapahFiZNOZiZgyoT6 +AwtlACcLxvBhwRdPesICoirIK46KCROSsBJub3MDcBPtvLGGvbm6S762PYBqOHxy/ ocn3mA/XkurtrKnr90J+QA56lRTiNBbv+pY/MFvZ0rmouk0pkDEVd0ZPfNEmwFSFW1 r9qDVSlnO+LwrciZPSviF4rfuMjb4ccKM9TqgK7Eq7T0RywMppm0+M/oBxfCwqBiXc mMUs2so9X9QSymm3frdp1PsKBn1+q3i2mI825+etFLLc3YcVxu7WZoQchgUphtT7+N KmfFECA6MbP9A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 19DDE181243 for ; Thu, 27 Jun 2024 22:01:57 +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_PASS,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)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 27 Jun 2024 22:01:53 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 97F1A114019E for ; Thu, 27 Jun 2024 18:00:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 27 Jun 2024 18:00:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; 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=fm2; t=1719525634; x=1719612034; bh=J1N08mr1JUDAFOYKL1KhPio/ktorotvZpfvpAc7NitI=; b= DhBidgkp4EtQv1BUWXfovs1AqsuxF4Sqh5dCAmaILaJu92kNp1NlbYIC3tOps2kc eFKfjGsrR0LK8Y77RIPHlU2HlTY5SRt4xB8iK0GvxkuiJGgZqyppZdODHHocZlXz n0HyEpcJy5xP6UyycdbHSgTNp3MalSqTKGoyhHyUTYdzR+A9ZTy8cX3iDCNj9+WY /mNz2kC00XfA+R6iNAtZqz1nCzDaJ5aESa5nOT9vAk6xYCZqkdbZ4iCEJD0bvhIl SHMGF+THv9RAhUvDAJsa02MBz43igDQGShDTywIpDDGXIgndXp427333Lk+eVXcT 4xKqlF0e+5FAU1whsewnjA== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719525634; x= 1719612034; bh=J1N08mr1JUDAFOYKL1KhPio/ktorotvZpfvpAc7NitI=; b=a RH1uhNYwvlpudGAgNiYlOmFtHd8f2okJFs30m6LpHZq2eQ8yDRNhb9iFuQu0iQzW KBRjHUZxAPO1RZXhnETx4MaZwHuYi0aG/UTIGkr/Od16p1ppfoJ4gszEu5j0IWmT Frp20kkkIspboPPW0BizrGTJmRscvAxa4l7JabQCLvaPF4b2ACwZuZkRAvywwWK/ afjXmFij6GPkeghSRBSpGDe3buc1wKZl8rpjZuHj5w6DkMlNHHqqkaOiVbBrpCJL 8D/4z8EW8l322cjBgcQwWVS0vP18AsmNMd7KPinM1fIMZBUHMsc4+epfWHJRl1qA UdR0LTqw6WDZUf8ILsAhA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdehgddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekre dttddvjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgnfdcu oehimhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnhepff ekveduffduvdehjedvfeekleeftddugeefheejudehgeeiudffgeeggeevfeehnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhmshhophdrph hhphesrhifvggtrdgtohdruhhk X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 27 Jun 2024 18:00:33 -0400 (EDT) Message-ID: <481ee7fb-5a9f-4f36-af19-7615ad38b81f@rwec.co.uk> Date: Thu, 27 Jun 2024 23:00:30 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript To: internals@lists.php.net References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 27/06/2024 03:15, 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. Thank you for sharing. I think it's valuable to explore radical ideas sometimes. I do think PHP badly needs a native concept of "module" or "package" - in fact, I'm increasingly convinced it's the inevitable path we'll end up on at some point. BUT I think any such concept needs to be built on top of what we have right now. That means: - It should build on or work in harmony with namespaces, not ignore or replace them - It should be compatible with Composer, but not dependent on it - It should be easy to take existing code, and convert it to a module/package - It should be easy to carry on using that module/package after it's been converted If we can learn from other languages while we do that, I'm all for it; but we have to remember that those languages had a completely different set of constraints to work with. For instance, JS has no concept of "namespaces", but does treat function names as dynamically scoped alongside variables. So the module system needed to give a way of managing how you imported names from one scope to another. That's not something PHP needs, because it treats all names as global, and namespaces have proved an extremely successful way of sharing code without those names colliding. Other parts of your e-mail are essentially an unrelated idea, to have some new "PHP++" dialect, where a bunch of "bad" things are removed. You're not the first person to be tempted by this, but I think the history HHVM and Hack is educational here: initially, PHP and Hack were designed to interoperate on one run-time, but the more they tried to optimise for Hack, the harder it became to support PHP, and now Hack is a completely independent language. I'm not even sure what problem some of your ideas are intended to solve, e.g. using "." instead of "::" and "->". At that point, it really does feel like you just want to create a new language, mixing ideas from PHP and JS, but incompatible with either of them. I do hope this discussion can inspire some interesting ideas, but I don't think what you've presented is the right way to go. Regards, -- Rowan Tommins [IMSoP]