Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98248 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64765 invoked from network); 7 Feb 2017 17:56:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Feb 2017 17:56:51 -0000 Authentication-Results: pb1.pair.com header.from=scott@paragonie.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=scott@paragonie.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain paragonie.com designates 74.125.82.174 as permitted sender) X-PHP-List-Original-Sender: scott@paragonie.com X-Host-Fingerprint: 74.125.82.174 mail-ot0-f174.google.com Received: from [74.125.82.174] ([74.125.82.174:33817] helo=mail-ot0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/9B-03389-26A0A985 for ; Tue, 07 Feb 2017 12:56:50 -0500 Received: by mail-ot0-f174.google.com with SMTP id f9so92023130otd.1 for ; Tue, 07 Feb 2017 09:56:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragonie-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=fuYQQmvcQv5BwvB2/neyRBrOedk7kNt+d7E4db6IlMw=; b=pND1aqhhLCtmp+7MiLYd3LLi/mvQClDPRoSjFel7MpJLN/09ZVFUVFJWMIv377pO3L DCUc+wic45jPNdCyvMDlxzC+SzLn+PsqDZS25CqoasfJJDx2wYNBPbpBy9ruOS/MlEp+ IoKVGyGXKviRUf1OvnWPZlui8EFHFTshL5UiDNFL+HMC66KQu3ZBel8c6BZJWEEO8dc6 9L+Ftyshd0OtqQFgngPM0HE2PVraXEIeLY6Q21j5EBZs+95sxt4XcXvdn5ZyeA19e1iQ roaoWIE3hXn5//7L9JJzvJh5VSpsdM3n468zQe6BdeBibZw8+3jlPr1Ox6qJI8baPQgB Baig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=fuYQQmvcQv5BwvB2/neyRBrOedk7kNt+d7E4db6IlMw=; b=dsdUKNNcHZHsW2dhXn2xszwErkO5evaDEXyfj5puFBvyWna7Y48fTOqDfTBo6NE5hQ Y637ILqjfOH2IsX1/8R9I6+mENu4HAxpV9norHX63HtA3S+Tz4/AW5ciK+nFtg/o7FD8 yFThNCHbf8v7MpjUvOYWjK/Gkic8iFfxI4mbcE8rNPKuId3CgIqtlG6N6FBquOHzfgyG SzCIMCeFLqQGHAT7GSCmwvA92f3Oe8TyvQN3UHaXXkKJevKo/Yevjh+tUPe384Pillhd yG970nrWZtdReNZrDpMr7lZtIixT7cvuG58nYrMY23VTJcqQ6PMAS1tIcaQ0YqAX6Lfa CuLA== X-Gm-Message-State: AIkVDXI7dq3pCqQWCiMnimhhVskFm2mwBGb4HJBc+Z55THwwe8kzGge35+ssikiUfGl1XRhtorpSw2bQs3GvkA== X-Received: by 10.157.60.203 with SMTP id t11mr9545723otf.235.1486490206814; Tue, 07 Feb 2017 09:56:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.56.141 with HTTP; Tue, 7 Feb 2017 09:56:46 -0800 (PST) In-Reply-To: <459c6bef-8936-634a-9520-dbd65c35b7c7@fleshgrinder.com> References: <459c6bef-8936-634a-9520-dbd65c35b7c7@fleshgrinder.com> Date: Tue, 7 Feb 2017 12:56:46 -0500 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=94eb2c192216bd584a0547f4787e Subject: Re: [PHP-DEV] Namespaces in Core From: scott@paragonie.com (Scott Arciszewski) --94eb2c192216bd584a0547f4787e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Feb 6, 2017 at 12:21 PM, Fleshgrinder wrote: > Hey guys! :) > > First: I like namespaces in Core but here me out! > > https://wiki.php.net/rfc/libsodium > > The second vote is clearly going to be that this new feature is added to > the core with a namespace. I already complained about this but it seems > to go unnoticed or others do not see the potential problems that might > be introduced by this. > > Sodium (or insert possible future namespace in Core here) might be a > valid username and existing community standards use the first namespace > for the vendor. Using those first level vendor namespaces in Core always > comes a long with a potential problem for users with that name. > > The PHP (case does not matter) would be the proper vendor name to put > Core stuff in, as far as I remember it is also reserved for PHP > functionality. There were also numerous discussions about providing a > cleaned up API there while maintaining backwards compatibility via > aliases and so forth in the non-namespaced Core stuff. > > Using the PHP vendor name as first level namespace would defeat problems > with userland namespaces and be a much safer choice. Hence, > `php\sodium`/`PHP\Sodium`/`Php\Sodium` would be the clear choice. > > There is another issue regarding auto-loading. If we randomly introduce > first-level namespaces we de facto make it much harder for us to exclude > some pattern from the auto-loader. However, putting everything Core > related into `Php` would mean that we can always sidestep any > auto-loader calls since we know up front that this must be a C thing. > > Most package and/or namespace system do that to avoid problems with > their users: > > - Java: `java*` > - C#: `System*` > - C++: `::std*` > - Rust: `core::*` and `std::*` [1] > - Scala: `scala*` > - Kotlin: `kotlin*` > - Ceylon: `ceylon*` > - ... > > Obviously there are some counter examples too: > > - Go: random > - Python: random > - Javascript: random > - ... > > But at least they go through an extensive standardization process where > the names are being discussed ad infinitum to ensure that they are super > generic and thus useful. It is very unlikely that `IO` or `OS` collides > with a username. > > I personally would love to see namespaces but I definitely do not want > to see random namespaces. I hope we are not going down a road that is > hard to repair later, like with so many other things we have in Core toda= y. > > [1] Rust decided against vendor names for some reasons they explained > once in a blog post. I believe that this will become a problem for them > at some point in time since coming up with nice names over time for > users is very hard. We'll see if Rust persists and invalidates my concern= s. > > -- > Richard "Fleshgrinder" Fussenegger > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > =E2=80=8BHi, =E2=80=8B > - Java: `java*` > - C#: `System*` > - C++: `::std*` > - Rust: `core::*` and `std::*` [1] > - Scala: `scala*` > - Kotlin: `kotlin*` > - Ceylon: `ceylon*` > - ... I=E2=80=8B would definitely like to see something like this land in 7.2: $plaintext =3D \Std\Sodium\box_open($ciphertext, $key, $nonce); Is everyone willing to allow the coding standard to be updated at all, though? I'm taking all the No votes spawned by this thread to mean "we don't want namespaced functions ever". Scott Arciszewski Chief Development Officer Paragon Initiative Enterprises =E2=80=8B --94eb2c192216bd584a0547f4787e--