Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120338 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89726 invoked from network); 18 May 2023 13:12:54 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 May 2023 13:12:54 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 838F218004D for ; Thu, 18 May 2023 06:12:53 -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,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 18 May 2023 06:12:53 -0700 (PDT) Received: by mail-vs1-f52.google.com with SMTP id ada2fe7eead31-43635b48672so185800137.0 for ; Thu, 18 May 2023 06:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684415572; x=1687007572; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=q0Rq7CrGZVdKYIIiHno+9acPy7etmQ2DxUikGVdcgJ0=; b=SNtwQ9UXOolL5JBdz0LDd62g3c7HOg60vioEDec84TonCbYno0qBv8xxsvAWE7OKkb 94eQ3so/FLAts7/VFuNrb0gchZPmsmaZ/CkdY0/qfv65EsmgKMLdxV8xs+RHGHpd3IJh ktrr9I0Vj747H1ZA0zN8/ceZ/9GYwxSj0QdMMq4gxofvn2nSLslxjsN+udwnZeHT3GHC 3O260d/cB49PSAAhpF7gRE64sEQNd5qknRynlJbNYbtjM/7eCy9J4X1JMZMfAfuiEQ39 ZMqsBlgl/S9phz59Z6cczZN04HNR606a1bkRj3cgFeAAHSdoeLKNEErwDR5ywjuOpMOM ahWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684415572; x=1687007572; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=q0Rq7CrGZVdKYIIiHno+9acPy7etmQ2DxUikGVdcgJ0=; b=jUB3AJhx72smEXa/1WeLgYzegD29MxqSplNDv3CwL8suOYKfvJr/xwtDSYFgrKfjkW KFUiagqHFBCqRH2RM91igLKoSqZaLmgS4pXBb7dpWGHcgXbahUcEdVHvH4ZwAOsRj9Qs SmeBKreRp5KT6D+c1KTo5sGg3ZVel8yZxgCeEvMSCTQfeSG4aNJ/J2AfZ2dlOf8fKBhO JjHifMPJyNpiPcmegwIqR79hpHpTgIHSEn9mFPb3CPTefhElwb6prBIfj+SJDgMzmrgX I7BsvTgeS6tgp+eIC2OUTKuMQLQe8pdbepJzE7I7ZO08Kcanew42yTpRcD2O4h4MBUS6 XbXA== X-Gm-Message-State: AC+VfDxn3rOMm80rnl70Z1bXf+JpM0hOWEYzDtTB1pvAVkbJujcnKuSn +ZPeBMMmXs+akYi7SFB2SumC7djNmAH0RuThGBnHP9mGGh4= X-Google-Smtp-Source: ACHHUZ6sMNV5dy/KA9zGCIGdf5OHfVa/ch42FwAxD60g/cx5u1q5v166G3zmgwKNYPrbksPYUH6FeAJUEpCCUkrds7I= X-Received: by 2002:a05:6102:a48:b0:437:e504:433c with SMTP id i8-20020a0561020a4800b00437e504433cmr327222vss.0.1684415572090; Thu, 18 May 2023 06:12:52 -0700 (PDT) MIME-Version: 1.0 References: <000201d9897f$aa9f9fa0$ffdedee0$@roze.lv> In-Reply-To: <000201d9897f$aa9f9fa0$ffdedee0$@roze.lv> Date: Thu, 18 May 2023 10:12:16 -0300 Message-ID: To: Reinis Rozitis Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000d428c405fbf78ff0" Subject: Re: [PHP-DEV] PHP Package for PHP From: deleugyn@gmail.com (Deleu) --000000000000d428c405fbf78ff0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 18, 2023 at 8:55=E2=80=AFAM Reinis Rozitis wrote: > > Which begs the question of a PHP Package for PHP. Some benefits: > > > > - Written in PHP, it will allow a much wider pool of contributors than > the > scarce pool of C developers contributing to PHP source code. > > Aren't this what frameworks are for (Laravel / Yii / Symfony / Zend etc)? > I don't believe they are. What they do is try to fill the language gap by creating competing implementations for common tasks, which then led to the rise of PSR in an attempt to further address competing abstractions. We definitely can keep living like this and forget about this matter. My wish here is just to be able to address a shortcoming PHP has with its standard library. My interpretation is that the PHP standard library was born in a completely different era and was a source of unpleasantness. It is a burden of maintenance on C developers and it has very little room for mistakes since once it's embedded in the language a breaking change has a devastating impact, which led to the current state of: "if it can be done in userland, it most likely should unless there's extremely strong reason not to". The bar of improving the standard library is too high and userland does not have the ability to define one common implementation that can be used across every project. The only entity that could take a step towards improving this is the PHP project itself. Why should PHP take on such a burden? - It's a greenfield opportunity within the language. I get a vague sense that it slightly resembles Kotlin for Java or Typescript for Javascript. Such opportunity could make a huge difference. - The burden on the current contributors of internals would mostly be about RFCs and discussions. PHP developers would jump in to provide implementation and maintenance. If I'm wrong here, then the project can just die out. I like Dan's description of an RFC here: > It might be better to think of the RFC process for new features to be > a decision on "should this feature be in PHP?" rather than a "must > this feature be in PHP?". If the PHP community cannot come in together to provide the implementation of PHP code for an approved RFC, then the PHP community does not need the benefit of it. - Plenty of opportunities for mistakes. If a design/implementation turns out to be wrong, we can leverage namespaces to "fix that" while keeping backward compatibility for the language at a very low maintenance burden. - High opportunity for improved user experience. If PHP implementation of something doesn't work for your particular use case, you can just ignore it and implement your own. But if done right, we can likely address 80% of use cases with standard libraries and allow developers to leverage these implementations across every single PHP project with no extra effort for the user. - Improved perception of the language itself. This helps attract newcomers to the language and reduces the burden of learning some of the PHP quirks of its standard library. - Modernization of PHP standard offerings and a home for language improvements with a lower entry barrier Perhaps I'm just in a honeymoon trap with the idea which might be blinding me to its downsides. The only one I truly see is the amount of discussion and bikeshedding within PHP Internals until implementations land. I don't know how bad it could get and how it would affect contributors' emotional energy. But I don't expect it to be bad. I expect it to be PSR on steroids. And it would be for a limited time. There's only so much we can offer in a standard library. And then we can enjoy its benefits for many years to come= . > Or PEAR? > Like that particular path_join() request is exactly > https://pear.php.net/package/File_Util/docs/latest/File/File_Util/File_Ut= il.html#methodbuildPath > > rr I have worked with PHP for 14 years now and I know nothing about PEAR. It either says something about me or about PEAR. --=20 Marco Deleu --000000000000d428c405fbf78ff0--