Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113659 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30779 invoked from network); 22 Mar 2021 09:50:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Mar 2021 09:50:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DBA001804D8 for ; Mon, 22 Mar 2021 02:45:39 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 02:45:39 -0700 (PDT) Received: by mail-lj1-f174.google.com with SMTP id u4so20190656ljo.6 for ; Mon, 22 Mar 2021 02:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WotzoW0rT2osj7zS8r/SgrNV5WLiEXKER4ekhypLeVE=; b=Si/WA8wp4CTmdYUy+zPwDSz/NRNX8A7VNGF5iEJVTnxYESsOrnWvtu/5Bz9jvSgWD+ uxTvvybBr8y6epSkUtE5VDCfUOc5B+AvtvhTKIsMB1Vy550+KVLcP9dHUgXfZWBovAhj H7jp+Tzvc3lQBNh+OggaPTnTqoRhllTyVQvxh4bKOdibfBVLiPgBGNvf1etSkeXOqXQz M9j0YhlF/Y+1KOuX4GdeaUWN4c6SPC3hWo5FdVMO7ZvCUAbEoqlHv1pTGgu8qg4NO2Xl IOaaUV7rh1KJyO7jTuyNRFMS1IbkiDnLtard51iHKt3ow1mFbdA3fOkJeER8hCXV95Jp RcTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WotzoW0rT2osj7zS8r/SgrNV5WLiEXKER4ekhypLeVE=; b=aZ5mRRWy0allxZpEM8TuXHW51QEtrh6KtAX0u9AwJwnJUzHEuQ66iFuw7K2CvRzYix qHYzOBLooMzUfk2FAwQlVUtm1+dBhm/fVLgxyTn0v/+2YfLYfR85xd/VGeZ/yM11VrYx rJW3M8HkV5YMw+a2wkMNjq9vLHBJI+Orjn9C9fGMZbd+KF/vFV9/DNQh5PFpFXrGftNe oZPnnQFF6ror1MG7v6Y6f16HdIzpT+9Ye11sdvr/Jf7Y2ImGHdwO75ZreXAC3ZXuwTo0 12TClrJktKRoEVqnYBBP+HSfYNbSycs0ZhlOuA1iWPrTLecfVpT9fPzg3Z7h5SJBcCP9 3Xqw== X-Gm-Message-State: AOAM531faEZgO4b9e2Qdxm8w8tCpfWvcJmlFY+ezpjpIvDrsRQhDTDMx wz5wi+dbnviQdLRJ1d9fcwYCsbueI5ROvF3o4l0= X-Google-Smtp-Source: ABdhPJxCRWkkeG+EAUr2mgf7dhrqXRf3VCOWYhY1068PkxkDKW96/mCot3mQblGRJ1CN6jam63u51bvZbXJxXed5X8M= X-Received: by 2002:a2e:8503:: with SMTP id j3mr9080020lji.272.1616406337622; Mon, 22 Mar 2021 02:45:37 -0700 (PDT) MIME-Version: 1.0 References: <341E78A4-B42C-4C4C-B0C5-A190187D6920@newclarity.net> In-Reply-To: <341E78A4-B42C-4C4C-B0C5-A190187D6920@newclarity.net> Date: Mon, 22 Mar 2021 10:45:21 +0100 Message-ID: To: Mike Schinkel Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000009117d105be1ced73" Subject: Re: [PHP-DEV] [RFC] Namespaced in bundled extensions From: nikita.ppv@gmail.com (Nikita Popov) --0000000000009117d105be1ced73 Content-Type: text/plain; charset="UTF-8" On Fri, Mar 19, 2021 at 7:28 PM Mike Schinkel wrote: > > On Feb 25, 2021, at 3:26 PM, Nikita Popov wrote: > > > > Hi internals, > > > > 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: > > > > https://wiki.php.net/rfc/namespaces_in_bundled_extensions > > > > 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. > > Hi Nikita, > > 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? > > 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. > > 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. > > 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. > > 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. > > I'd suggest registration of really generic namespaces would be > discouraged, but not disallowed. > > 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. > > 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. > > 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. > > Is this something you can/will add to your RFC? > > -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 > No, I am not willing to add a namespace registry to the RFC. 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 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. 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. Regards, Nikita --0000000000009117d105be1ced73--