Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118743 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89024 invoked from network); 4 Oct 2022 22:52:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Oct 2022 22:52:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B433C180211 for ; Tue, 4 Oct 2022 15:52:18 -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=-2.1 required=5.0 tests=BAYES_00,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-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 ; Tue, 4 Oct 2022 15:52:18 -0700 (PDT) Received: by mail-lf1-f41.google.com with SMTP id 25so12905102lft.9 for ; Tue, 04 Oct 2022 15:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=AtTPpma+LCG7/TWLhecakn1qEloSXuOiO7fPqKwaHKA=; b=Zn1fCt5XoedjTridNJXRLHomDXbQJlPK66UcavEkjJsI6jndc8jEteCUJnYGmxjF6H aOEnLdNXZZAJs3mTJA2Cuc8+VfelAYBEIrZuJpkzs74Uk0R2M6vCQx1QsX+yrhU0guvQ 4uHU4I01eQ29IMzWdP3dn9rha3M8xzTUXMWuGQQpr3u/MSGEyDRM+XwmN2fT+PsQ9ZOQ d+dyb8fJ/mkGe4z1Bsx54k1YzNOPTNwTY+qOcMA2yHJfmhM2MUPsYD8QxkVUZQIvUdSR VUtkktjOSS6HEX//rnyFzgWlPcBcFW5iG8+MVQZuzxfb+IM4MSmMRwv4vZT6hSs7Zq4u YVmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=AtTPpma+LCG7/TWLhecakn1qEloSXuOiO7fPqKwaHKA=; b=VSyKWely6hIpuLr6XBSOetU6/10vHU5MQlR5f4N0lJ+tDEvLphI7DksCCO4v6GTvJh XuvTsJMpGeNFxjvFpEqh4FcoJbBK/FVV6dQiN11cHAnhWZThs9Qdk5MSl7Xi/pO4Z4Y6 2dXef1L87p88GkDE2so+B/9wrD0nONc1CRpeT+dnnbC0+mr+qU7Ah0IKn5I2inOO5p54 KlvigHKJTp6X6D5JV2NXryrSYl4rr+RRzKyKT42/ZrwbZXYdFmwy7Q0FkpQU8pqWS2nz OdsXemaD8tCLZ0QBVdDiJnogBMxl1MLTbi4xigiLqy4I0OMpbjMMKuztvEHQ7meMobFl Yy5w== X-Gm-Message-State: ACrzQf1O1cElrQFh4zp+yDTjrUFZb9vNvBgl1PuA+I43LmR7B8lvTAGv OzPJl6OP0WFRD7nTP4eYyk6NuCM9PI6cwcYdj6Y= X-Google-Smtp-Source: AMsMyM51CjOF2jQwSo6OCZ74vz0QmAb01z9muAEFVYQ7zpWKp5JfDz6peR2zgsX97eYIuQlxlVCc3iB0GbjnyvI5UH8= X-Received: by 2002:a05:6512:1107:b0:49a:d211:bb3c with SMTP id l7-20020a056512110700b0049ad211bb3cmr8953347lfg.423.1664923936425; Tue, 04 Oct 2022 15:52:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 4 Oct 2022 19:52:04 -0300 Message-ID: To: =?UTF-8?Q?Fl=C3=A1vio_Heleno?= , Hans Henrik Bergan Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000cf0a2c05ea3d4fc0" Subject: Re: [PHP-DEV] Experimental features From: david.proweb@gmail.com (David Rodrigues) --000000000000cf0a2c05ea3d4fc0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Fl=C3=A1vio and Hans! > Could this be done through extensions instead of having to develop a new process/support code? I believe it is possible, however, the main part of the idea would be that "common users" could try out the features without having to know how to install extensions, while there is an explicit notion that the feature used is experimental (via experimental_() prefix for functions or method, for instance) and that the goal is to test it to become part of PHP itself at some point, not more as an extension but as a native part. So if these experimental extensions are available natively and enabled by default, it would be interesting, because it would be easier to separate the main code from the code in development/refinement (and that can be rejected at some point in a more practical way, and maybe be kept as just an extension apart from PHP). Atenciosamente, David Rodrigues Em ter., 4 de out. de 2022 =C3=A0s 19:37, Fl=C3=A1vio Heleno escreveu: > On Tue, Oct 4, 2022, 17:43 David Rodrigues wrote= : > >> I wanted to suggest the possibility of introducing experimental features >> to >> PHP. >> >> This is an old thread I guess, but I think it's good to reevaluate the >> situation from time to time, as other languages already do this to some >> extent and PHP doesn't. Some platforms/languages (Node, Kotlin) and >> libraries (React) bring features natively in an experimental way. >> >> I wanted to propose that we bring this idea into PHP, so we wouldn't hav= e >> to wait for new major/minor versions (eg. 9.0 or 8.2, 8.3) to try out >> these >> new features, and so when these versions arrive, they'll already be quit= e >> polished, avoiding patches sometime later due to wider usage of users. >> >> My idea is to have two levels of experimental features: >> >> (1) Via declare(), when the feature affects how PHP can act when reading >> the file itself. Eg. declare(experimental_operator_override =3D >> true), Something that happens with Kotlin, for example, when we use some >> experimental annotations like contracts. These declarations work "per >> file", so whenever it is necessary to use it, it must be declared. >> >> (2) Via experimental identifier name. Eg. experimental_json_validate() o= r >> Experimental::json_validate(), like in Kotlin and also in React. >> >> Experimental features can only be brought into a minor version (eg. PHP >> 8.1.12) when it is minimally refined and practically ready to use. It >> would >> be "kind of" an expected final version, no new patches are expected (we >> hope), unless something really went unnoticed. >> >> Despite this, experimental features may not exist until the next >> major/minor release if its practical inefficiency is found or if the >> concept is shown to be invalid. So it should always be a "use with care"= . >> >> However, if an experimental feature is successful, it becomes final at t= he >> next major/minor or major/minor+1. The experimental version becomes an >> alias during some future versions until it is removed entirely. This is >> the >> time for users to adapt their code and for IDEs to help us find them. >> >> With this, we can understand whether users are making use of a certain >> feature or not, make improvements on it, etc. >> >> I notice that many good features are rejected because they are believed = to >> be bad for PHP or can be confusing, but without any practical testing. >> Experimental features can make this analysis more grounded in practical >> data than just possibilities. >> >> However, this also doesn't mean that any idea can become an experimental >> feature, but ideas that have a good foundation and a good discussion >> before >> it. The difference is that the feature can be tested in practice before >> being totally rejected, and approved features can be delivered ahead of >> time to refine before the next version is released, allowing users to tr= y >> them out more easily. >> >> >> Atenciosamente, >> David Rodrigues >> > > Hi David, > > Could this be done through extensions instead of having to develop a new > process/support code? > > When json support was first introduced into php, it was done as an > extension and then, after a while, incorporated into the core. > > > --000000000000cf0a2c05ea3d4fc0--