Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124024 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 2761A1ADB42 for ; Sat, 29 Jun 2024 10:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719655348; bh=crc5jeuonR6ekd6+UuEPFbgDSJxkldxhetUJyEHTDCE=; h=Date:From:To:Subject:In-Reply-To:References:From; b=oGwiMTrS1dmnm+Oh5gwLXKjcPpUtQ5jWY216G1cVF/UTS3XrNEKWPiD4e7yXi4JyL ZVTyG7VNpek/cKOAOsLl5Q6x4lF3ig4QhpqeaGgadpXRabLF2p4+VduR/BfIMJ2LOM UUR/2+YWboIdEk8DEJErawl6sO7XU5E0Q8fTiD3vV9AnMoWq940Ppc4c+hG+DhCQRv MY1l8TQ6iB6ixgY/xYx7RpvH+yETu7MY0r6cuc8N9yJXluLW6jm2wHmdO8UOQpEJAY HoITaJGeMFGg+lwaoNHg/OIsimXbqLCJ0O6n0DEc27maZxgemVYhp9MFNOJY5Sts1s deJ/N9TKBmmVw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0C633181295 for ; Sat, 29 Jun 2024 10:02:23 +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 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 ; Sat, 29 Jun 2024 10:02:20 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.west.internal (Postfix) with ESMTP id B880918000BB for ; Sat, 29 Jun 2024 06:01:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 29 Jun 2024 06:01:00 -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=1719655260; x=1719741660; bh=crc5jeuonR6ekd6+UuEPFbgDSJxkldxhetUJyEHTDCE=; b= QBxNu2NIP5rt+mNTF+oDzxqabmhKYd+URKqYqZ5dtGU0NeAnIkP1h7sdDI6MAy0U SgDviaG9oC6MG/4/nhqSqNGu4qONG3NcLZqcSxl8OjHxngp36vgtSCpdW043d9VM txt6FEN46Vu/V3ZV3nGmfE0dSIavTDxCbPpD/nHseel2bN9gTKyFr3LhfKOJNvkF /LMx8hqNfbZ7tni7ajuJGYCYCE3USs/FXxQ7dCfw7oDxrT6+FqwvtWoddVDonxwU 6K8q2YfwQllgY5pO4NIhIrG6fywbdCbTgTMxvRpdgHACup1m403XxST5q+R4XKbu wuImpjHZokdDtTyamEpzSA== 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=1719655260; x= 1719741660; bh=crc5jeuonR6ekd6+UuEPFbgDSJxkldxhetUJyEHTDCE=; b=s gnOCqlvNmlcsfDCsvSqD7uCbZrM5t5L6BvJetBZRS+BfWoU2P5wORsrac/4f5nfy aME/UHy/URqmp20MfjoMI8NIEOriJxkJv+5pg71E6fuTAsBg01sJ6H9mMCNopoXj D1B2yLyFvpkW83fM5HspkDnjCdkW6Wcloy/jZaCopen+rrwqwXQu8eH0bFFJKHbB qQjDovyk9PFRjDlYr5oNs6aOmwMsio0qo+4G3l0w3mN4NXUoMy9r636DQvUCy+O5 Xtj5pvLD30YGhmjJWgh2C8VkyqCp8NSaV21JC5ldP0aZ5Eop+V0yZaPXvRD/wwLL uRZyD2tiAnj8BK7NTGHHQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdelgddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffufggjfhfkgggtgfesthhqmh dttderjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgnfdcu oehimhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnhephe euledvffeuffefuefhjeejhefgtdfhieetieeigeejuefhffefudetkedvvdegnecuffho mhgrihhnpehinhhsthgrnhgtvgdrnhgvthenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukh X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 29 Jun 2024 06:00:59 -0400 (EDT) Date: Sat, 29 Jun 2024 11:00:57 +0100 To: internals@lists.php.net Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_=5BInitial_Feedback=5D_PHP_User_Mo?= =?US-ASCII?Q?dules_-_An_Adaptation_of_ES6_from_JavaScript?= User-Agent: K-9 Mail for Android In-Reply-To: References: <0acedb8e-34be-4348-907b-4075cf7641fd@app.fastmail.com> <9c20b078-f82a-47fe-af23-2f3cdd233079@app.fastmail.com> Message-ID: <50529C6A-42BB-4D49-B720-FE1847577484@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 29 June 2024 08:06:57 BST, Mike Schinkel wrote: >The takeaways that I think would be useful are PHP modules are: > >1=2E Imports >2=2E Import aliases=20 >3=2E Module-level consts >4=2E Module-level init() functions >5=2E Module-level vars with initialization >6=2E Module-level functions >7=2E One directory =3D=3D one module >8=2E No hierarchy for modules >9=2E Single word module names in lowercase=2E >10=2E Module sytax being , e=2Eg=2E mymodule->M= ySymbol This all sounds like an interesting set of ideas for building a new langua= ge=2E Most of it sounds completely impractical to apply in retrospect to an= existing one with millions of users - apart from the bits we actually alre= ady have, like points 3 and 6=2E Rather than looking at languages which have done things completely differe= ntly, I think it would be more useful to look for inspiration for ones whic= h are *similar* to PHP's approach, but have extra features=2E=20 For instance, =2Enet has both "assemblies" (multiple files compiled as one= redistributable unit) and namespaces (which are hierarchical, like PHP's)= =2E "Package private" modifiers work at the assembly level, not the namespa= ce one=2E =2ENet assemblies don't have to be limited to one namespace root, but in p= ractice generally are=2E For PHP, I think there would be some benefits to m= aking that a fixed rule, with some tricks to "re-open" a namespace, or expl= icitly add "friends" to it=2E I don't know much about modern Java, but it too has hierarchical namespace= s, so there might be good and bad experiences we can learn from there, as w= ell=2E And I'm sure there are others that are much less alien than JS or Go= =2E Rowan Tommins [IMSoP]