Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110718 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 47071 invoked from network); 24 Jun 2020 20:45:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jun 2020 20:45:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 92DF6180543 for ; Wed, 24 Jun 2020 12:32:42 -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.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 ; Wed, 24 Jun 2020 12:32:42 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id f7so433291wrw.1 for ; Wed, 24 Jun 2020 12:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=U40XSjUF0kXjfk6aoAg+tUSB02X+zD5wSO+wZY/HakY=; b=NMyFCeebiI5a7CPkL4hNgVjW/sl3FxuFzPESjs2Cg5gDbkVrjIMNxlADiAFByR7nED II4grI9LFcbf4cs7CDZxvHGyrbmWz38S0q0eTHDkUDbwoZXDnE4ivIV3pcp5fVed9edA v89JKcGqrWDID9HbmBUE81arutkVZEb32o5omonC2EcbOAVvpWjsoNxrbKk4Mk50M6x8 qd3QXzbJvnqr7bu8HucpgheK067cc9QHGR+ku/aEnr+QZVfm6+WzC05lwELOSX9ficuQ ZnW5MUfzQcw/6DMJtDPBeRdRuRMMi80Udo6cm5o7d5jpa7edgMahZs8Mp3LU1Ac7KkKM KZhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=U40XSjUF0kXjfk6aoAg+tUSB02X+zD5wSO+wZY/HakY=; b=qSvOBQJRkogoNu+dVtDcm92Qi5J4+FUJfyY4WLA6703TzvxDOsn0GGchr8mdsDNF5f X7o8uDlEIFGuYwBM1r6DqdTs9rnTuk/GcsMVfkecQFAOdDr4E9Y/RLEUAqj2GrrMgab2 vS679M9FQVptsrPMPIeMm7bIbF+SWazWhZdWBCfJtua05R0MF49zhngWM6lKN+MRavwG MtxYTuT/MP6774Ct2J129DGJKrHeHIipw5wDHhhdaRuZVfcrJzmuxQV6sxc6jkCg5+pF BLeMxaIgEbTFr4JVK1jC3PinbRbJhlqVJnJVpm1Gn9HApFY0MBRMDQJokw7vf0t77Wfh wanA== X-Gm-Message-State: AOAM5309rHnODL6dAfqH2Dwp5C+V845LyNAzkwH81LI1e2yMGPq4h6tZ d3JNxe+zOfvQJhdHpzCLrOUJAR56 X-Google-Smtp-Source: ABdhPJxxzbw1Q6MB4P3w7+bDF4ca3hyT6XUhj6ATP839fMSUrMm4vmhzxZ6X6FgqLjKCbOy8ym/hTg== X-Received: by 2002:a5d:4089:: with SMTP id o9mr25719229wrp.404.1593027160490; Wed, 24 Jun 2020 12:32:40 -0700 (PDT) Received: from [192.168.0.22] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id e5sm26553119wrs.33.2020.06.24.12.32.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Jun 2020 12:32:39 -0700 (PDT) To: internals@lists.php.net References: <0771c3ac-53ec-4a7f-a4e9-6ae3c9b1f1f6@www.fastmail.com> Message-ID: <981040f9-afdb-2a55-01c5-1afc2c057193@gmail.com> Date: Wed, 24 Jun 2020 20:32:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <0771c3ac-53ec-4a7f-a4e9-6ae3c9b1f1f6@www.fastmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] \PHP namespace usage heuristics From: rowan.collins@gmail.com (Rowan Tommins) On 24/06/2020 01:30, Larry Garfield wrote: > * We should never namespace anything ever. > * We can namespace things but we need something more concrete than "RFCs can namespace things if they feel like it." > > I can't do much about the former, but the latter is a solvable problem. To that end, Mark Randall and I have put together a new RFC on the topic Hi Larry, Thanks for moving forwards with this. To stretch an analogy, I think we're better off picking out the colour scheme for this bikeshed in advance, rather than just resolving to buy some paint when we need it. :) One section that gave me pause reading the RFC was this: > A component namespace is “claimed” by the RFC that first uses it. Once claimed, that component namespace may only be used only by that RFC or future RFCs that extend that one in a natural way. PHP RFCs tend to describe a change rather than a full feature, and once accepted are more a historical record of the change than a living reference. Perhaps it would make sense to create an IANA-style "registry" of reserved "component namespaces", so that RFCs could add, and more rarely amend, entries in a central location. This doesn't need to be elaborate - just a table on a wiki page somewhere, with columns such as name, usage definition, status (e.g. unused but reserved for forward/backwards compatibility), and maybe notes on naming conventions within the component (use of sub-namespaces, suffixes, etc). One thing the RFC doesn't tackle in detail is what we might call The PECL Question: what are the processes when an extension moves from PECL to php-src (like ext/sodium) or from php-src to PECL (like ext/mysql)? For moves into PECL, the RFC says that the component namespace "remains reserved". If we were maintaining a registry, this could include links to PECL with appropriate status notes. For moves out of PECL, it's trickier. If we have PECL extensions listed on the registry, we could have some way to register them *before* the extension is added to core; but I'm not quite sure what that process would look like, and what kind of endorsement it would imply of the extension. If we don't do that, what would happen when an extension becomes part of core and needs to rename functionality from "Foo\Something" or "SomeCorp\Foo\Something" to "PHP\Foo\Something"? One answer would be to follow the same process as renaming functionality already in core - i.e. include the old names as aliases, subject to deprecation over a major version cycle. This would help users migrating from the PECL extension, but users of "vanilla" php-src might be confused why there are two names. Worse, it would defeat part of the point of the PHP\* namespace, since php-src would be claiming names outside it which could conflict with other projects. Perhaps a cleaner approach would be to add the extension with only the new PHP\*  names, and provide a userland polyfill for users upgrading from the PECL extension? Regards, -- Rowan Tommins (né Collins) [IMSoP]