Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113687 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92073 invoked from network); 22 Mar 2021 17:19:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Mar 2021 17:19:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 90FF71804DD for ; Mon, 22 Mar 2021 10:15:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 22 Mar 2021 10:15:12 -0700 (PDT) Received: by mail-qk1-f195.google.com with SMTP id o5so11317147qkb.0 for ; Mon, 22 Mar 2021 10:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=dRjts9DD3K/5MUsujyc2Xqcgw8wdGNUaqCYYguSa+iY=; b=RvFryn1hGCPAd5sF9e+MyZyWqKEVfDfHje8YPvz/PWU8J/zYfEeQ5UNUlQ1ATKn2jz nptOrUBDqcX9/t8vt5XzZ1M0MNx3NhMTeZYcGJdrcWjTQ8tO06JOhqvN3vnDtYywR+ok 00/VhkoC+PQXNmluhXFMkLlBW1sM7L+7WqF2IJkPVs5RxI6m22y5EiDnvceSibt4nDd+ RLsDayfL6Bn2wvFqsBGcjUkP6NGpeIyUpCo5CO3T5sEgoEshLgHE1SvI7o3Vv9DIi5S3 nei5gEv7Jgtr4gBmOcpUr1c95TzX2qcV86Y3Zo9Hi97B/rMtWxDrw1RKPt4eiwGRFjyU 00uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=dRjts9DD3K/5MUsujyc2Xqcgw8wdGNUaqCYYguSa+iY=; b=R56Ut3WL8BJ44HGxb6rV5BbGvN47hnCXXlMSWhXnC9zM6DrohW0C/VArIYLCRxvkus dm6w7R8d4ZlVMfS/9FCM+wtWnFG0/uRFEtOf5c/uKVh+Z5ZK4fy0jPY1/iP72gkuHhS+ BhYyRbBMvxH60OniD6Fbyo+4jb3FJoWPlSAygC3ELtl6fS1NWXp1PUjLIpUDrBG62R3R tBDlZWlo3ZkrU2sQ3WRQEoglPhPbEQKZFIAYandVGlwQKK9fkpgTlKgTBcXLk5iAaM0d 4uWJQGRddFIQYmdpOrrXPVo6uhLuqP9R0Gkamv8+Mkgp9GGZh4iS/0RZqc3I/JdaKVNA sygw== X-Gm-Message-State: AOAM530ThcurkXcVBW/OFzyz8kKehif278gZsWd/8oCMYm087kfRW4Av M3DqAoo+vRbnbIcnkYpmP5JLdQ== X-Google-Smtp-Source: ABdhPJzsqT/nfuFYVRAEVlPLNefB/n6BHHHrtLrja/fTNfSVDKaC7QOKUwjZh+M0FHQIFRP7jrfnPQ== X-Received: by 2002:a05:620a:2013:: with SMTP id c19mr1022639qka.403.1616433309681; Mon, 22 Mar 2021 10:15:09 -0700 (PDT) Received: from [192.168.1.239] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id s13sm11245649qkg.17.2021.03.22.10.15.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Mar 2021 10:15:09 -0700 (PDT) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_4D6D168B-EF5B-4B60-82DB-5B197B16E97E" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Date: Mon, 22 Mar 2021 13:15:08 -0400 In-Reply-To: Cc: PHP internals To: Nikita Popov References: <341E78A4-B42C-4C4C-B0C5-A190187D6920@newclarity.net> X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Re: [PHP-DEV] [RFC] Namespaced in bundled extensions From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_4D6D168B-EF5B-4B60-82DB-5B197B16E97E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Mar 22, 2021, at 5:45 AM, Nikita Popov = wrote: >=20 > On Fri, Mar 19, 2021 at 7:28 PM Mike Schinkel > wrote: > > On Feb 25, 2021, at 3:26 PM, Nikita Popov > wrote: > >=20 > > Hi internals, > >=20 > > The question of namespaces in the stdlib has been coming up a lot = recently, > > so I'd like to present my own stab at resolving this question: > >=20 > > https://wiki.php.net/rfc/namespaces_in_bundled_extensions = > >=20 > > Relative to a number of previous (declined) proposals, the main = difference > > is that I do not propose a top-level "PHP\" vendor namespace, and = instead > > recommend the use of "ExtName\", in line with existing practice for > > extensions. I believe this addresses the primary concern with = previous > > proposals. >=20 > Hi Nikita, >=20 > Can I request/suggest that if we are going to take this approach that = the RFC also adds an "advisory" registry for namespaces in the form of a = Github repo with parallel README.md and namespaces.json files containing = "registered" namespaces and a link for more information? >=20 > The benefit of such a registry would be to allow people who want to = avoid using a namespace others are already using in public to find the = list of namespaces for code that has been published publicly. Full stop. >=20 > For what I am proposing, the registry would NOT be used to _stop_ = people from using "registered" namespaces. They would be free to do so = if they chose to. The registry would instead be for those who want to = ensure their code is most likely to play nice with anyone else's code. >=20 > The registration process would be as simple as submitting a PR that = includes the requested namespace added to both the README.md and the = namespaces.json file along with a link for more information. >=20 > There would not be any approval process per se other than merging the = PR, and there would not be any "owner" of the registration per se as = registration would merely be a stake in the ground to recommend others = not use that same namespace.=20 >=20 > I'd suggest registration of really generic namespaces would be = discouraged, but not disallowed. >=20 > I envision the link to more information would be a link to a git repo = with either the code or information about the namespace in the README. = If after a namespace is registered we find that other = people/organizations are using the same namespace then the maintainers = of the repo could choose to add multiple links to the same namespace. >=20 > Again, in summary, this list of "registrations" would be to allow = people to easily find out if the namespace they want to use has already = been used publicly by others, and if not to allow them to "register" it = for their use. >=20 > If maintainers of the repo discover and PR behavior that is suspect, = they could bring to the internals list to discuss a resolution. But = unless and until that happens, governance of this registry would be as = minimal as possible. >=20 > Is this something you can/will add to your RFC? >=20 > -Mike > P.S. If this existed it would be something PhpStorm (and VSCode) could = probably use to help developers who find namespaces in code to be able = to find out where they can learn more about those namespaces. And = later, the git repo could publish a namespace.json with a lot more = information about the namespace that could help PhpStorm offer even more = help to developers. #justsaying >=20 > No, I am not willing to add a namespace registry to the RFC. >=20 > I do acknowledge that the lack of vendor prefix may make namespace = collisions more likely, although an important mitigating factor here is = that that userland libraries (unlike existing extensions) do typically = use a vendor namespace, and vendor namespaces usually do not collide = with component namespaces. I appreciate and respect your decision. > I also think that there should be some common courtesy involved in the = choice of namespaces -- if there is some really popular unvendored = open-source library out there that already uses some namespace prefix, = we definitely should consider that in our naming decisions. >=20 > But I don't think this needs any formal process of namespace = registration, which creates unnecessary bureaucracy and misaligned = expectations. If your library is important enough, then people will be = aware of the issue. The converse also holds. But I do want to point out it can be difficult to discover namespaces = that may conflict when they are not the main namespace for a popular = open-source solution. So it sucks for the developer who wants to use two = conflicting "not important enough" libraries. But I do accept that this idea is a no-go in your RFC. -Mike= --Apple-Mail=_4D6D168B-EF5B-4B60-82DB-5B197B16E97E--