Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95125 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76128 invoked from network); 13 Aug 2016 21:20:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2016 21:20:18 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.171 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.213.171 mail-yb0-f171.google.com Received: from [209.85.213.171] ([209.85.213.171:35310] helo=mail-yb0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 89/16-36656-01F8FA75 for ; Sat, 13 Aug 2016 17:20:16 -0400 Received: by mail-yb0-f171.google.com with SMTP id z96so5513994ybh.2 for ; Sat, 13 Aug 2016 14:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VbjcJrcdzG6zBtWK4vw2Nu0uJ1f5tU47xQUGlD8WvXI=; b=DODcOVUQBPqwu176ubKJfKsN5IMxqyT3bFOV/mGItynygEPevkZP/R50JdOQAlcF7G PtAAADRfHgl95EUyR8+XdVgLwBQidwhHSXAmi14RJ+rMYW9qllEeg5wwudrPp/wp2fE6 ZATVjOWvxqdFcn9YU7mj5gdsJiWVjLKAz99GggYuZ8AVL/Sjc/0zla0Jo7P5hilyVaCX T9ePvpj77N4UuPBE+SOHKoxPvocLqzSkk/C3nPGgzY9KRGItRx4Ymw66WfAMkgnMxRnW IOLHT6yBNusNklkGgmIsGxSQYN0B69oU4sMSWeRLP1720azpP6KRef4+yvQnBxqtK7bD SR1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VbjcJrcdzG6zBtWK4vw2Nu0uJ1f5tU47xQUGlD8WvXI=; b=CziOIL2CR3tafptUQSWqaRiw6lDZXsf7qVCRHmNYGb1SHhclmOqKzdL731u6CJ9cev 8PJgUF2gTviXSGCnc/0OmfgPgYLGbYDinuscSwxqb118HoDPnT62q4cconhR6np0BuA2 z5jojxw9EH0Y9eUuuNr0XVcrTv3s2S10kbxcS0Zf7GYEB6I+I2wC2m+IoUtQ/6U3+L+W 8uisSQoPJZQZT+G7DIsKX2MkhJwTbICfwc9BzcjWS3uaBOwGphjtA1J45RpBA6nHtgkB JoVke5ipL3qafbZol+U2+5iRQ5Bq9iwuQ7WiNikzHB/OBFBOuWIh/GE5PHifbJrofUkA S1zw== X-Gm-Message-State: AEkoout1c7N47ynUqJ5A39xMmzuaB0CkUmIm45f5C8MEViWowvDJbogQP2CzX0dbAwQyReTlu9zBdnqK6PPQQA== X-Received: by 10.37.207.80 with SMTP id f77mr9756209ybg.141.1471123213496; Sat, 13 Aug 2016 14:20:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.85.67 with HTTP; Sat, 13 Aug 2016 14:19:53 -0700 (PDT) In-Reply-To: <11f9c899-77b4-da50-f0f7-dc2d16b1829c@gmail.com> References: <11f9c899-77b4-da50-f0f7-dc2d16b1829c@gmail.com> Date: Sat, 13 Aug 2016 17:19:53 -0400 Message-ID: To: Stanislav Malyshev Cc: PHP internals , Julien Pauli , =?UTF-8?Q?Micha=C5=82_Brzuchalski?= Content-Type: multipart/alternative; boundary=94eb2c05578e8fb69c0539fa90d2 Subject: Re: [PHP-DEV] Namespaces internal refactoring From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --94eb2c05578e8fb69c0539fa90d2 Content-Type: text/plain; charset=UTF-8 Hi Stas, I'll answer your message as it directly refers to links with my name. I understand the reasons of why namespaces were implemented that way, as I follow this list for quite a long time. I never complained about the implementation itself as it was publicly introduced originally back in August 2008, when first PHP 5.3 alpha 1 got released. Today I see 2 sides in PHP Internals. One that truly believes that PHP should adopt more concepts of object orientation, such as Annotations, Generics, Overloading, Class visibility, Collections, Exceptions, etc (the side I support) and the other side that wants to make the engine more robust, stable and faster, without entering in a rollercoaster of new functionality to be introduced that brings instability. One thing that didn't change is the constant increase of developers writing and rewriting software using the language. Now these developers are also improving their skills, and demanding more flexible ways of achieving their needs. Language evolution should also be in compass with these new needs, and that's where I think PHP is struggling to keep up, for a variety of reasons. Being a constant contributor to open source and many libraries that now drives most of what people consider as "Modern PHP", I constantly face problems with the language itself being unable to achieve my needs. When I say my needs, I mean needs of heavily used libraries, with hundreds or thousands of other projects depending on them. I'll highlight the main driver of "private classes" conceptualization, in an attempt to make this email short (which I already failed). I wrote a DAG sorter as part of one of Doctrine packages. Many people started to instantiate (and use this class, even though it was marked as an @internal) and consume the benefits it provides, until I changed its API working on a bug fix. If this class was never intended to be used outside of the scope of this project, how can restrict its usage by outside packages? Feel free to provide me answers or alternatives, and I'll happily agree with you that private classes is a bad idea. Namespace implementation is now the blocker of many new features that could help solve complex problems that you don't see on a daily basis, but library developers face daily. For example: allowing to assess imported/used structs when declaring a class would drastically reduce the complexity of Doctrine's annotation parser, which required token_get_all and several logic to check for what you're including. Is there a better solution for that too? Well, I'd argue Annotations has a market, and people are just blind if they don't wanna see it. Answering that implementing Annotations in userland is a bad idea is like telling a corporation shouldn't create a product because you don't like it. Makes absolutely no sense. I do have a lengthy, detailed and complex plan of how namespace refactoring could be made, what it would enable feature-wise, and how it would benefit many projects. I'm open to share with you or any other internals developer, assess impact over PHP source code and even help implementing it. I'm just unable to do it all by myself due to my poor C knowledge. What I don't want to see is blind resistance to language evolution and blaming over something as badly designed without understanding the circumstances that drove to that implementation decision. Regards, On Sat, Aug 13, 2016 at 3:20 PM, Stanislav Malyshev wrote: > Hi! > > > The current approach to namespaces blocks new features like you see it > > in the following PR. The link already points to the two most relevant > > comments that should give you full context: > > > > https://github.com/php/php-src/pull/947/#issuecomment-224912697 > > I don't think this - private classes, etc. - is a good idea. It looks > like Javaization of the language and introducing more and more > complexity without any clear benefit, and AFAIK none of the mainstream > scripting languages have such concept. Anyway, this doesn't even have an > RFC, so I don't see why we should refactor everything to accommodate it. > > But it is certainly does not fit the concept of namespaces. It needs > completely different packages concept - one that currently does not > exist on PHP. Trying to bolt it on existing concept is not going to do > any good. I think this is what it should start with - developing a good > concept, not trying to go from code modification to design. Design > should come first, then code modification. > > > You might know other approaches to solve this. What I want to say is, we > > should not re-discuss everything that was discussed before, we should > > discuss the proposed features and refactor the namespaces IF it is > required. > > Indeed. > -- > Stas Malyshev > smalyshev@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Guilherme Blanco Lead Architect at E-Block --94eb2c05578e8fb69c0539fa90d2--