Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121764 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83908 invoked from network); 22 Nov 2023 21:53:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Nov 2023 21:53:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 22C7D180048 for ; Wed, 22 Nov 2023 13:53:38 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 22 Nov 2023 13:53:37 -0800 (PST) Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-548034455d9so66871a12.1 for ; Wed, 22 Nov 2023 13:53:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700690012; x=1701294812; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6S7DrcSYEosGFsZjsmU1KSeiQ1ApHVoxHTvbkmeYMOg=; b=gF0FJGiGkNl6piAYgB7i71URYnhdy34vOMITsqqw4cJ9yjT42qhtF+/g8sX0Gb/F1V 46SxdxOWICrYNbx0qwtsNxWde3hpJAWQtfH/a41qouXTesa2koNuSQWXuSU9RW+YNZ4v aUxk+BnnG0Fv7WPlZbsZ8bfogfYH4pss4PBTGHIGATgP9B0OS4w9FfSqPD0OK1bm6980 Vs2WyD3aCQG09EcKE0zhwKfJNBvL+wPGxtlqNX6oNtOsMRk2hz8mDrPlU+/lwdtyiqQd H0ucX4y/iVuZkuJU2t+qYHm+n080qiUANAVcp+/dvWuIUGzCStC4pZ/+QOJvlMyYb7FN TaEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700690012; x=1701294812; 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=6S7DrcSYEosGFsZjsmU1KSeiQ1ApHVoxHTvbkmeYMOg=; b=NoAA0BgfgSSB9UnGXoCFLuBGgk2cAkhxmNh4acW3VgKHmPPwQMhJDIydJHS73qob/J n5o4PBvy3VrKBDP6+Tvj4r0PpCymPeUSlJtYRwZUnE2lqHHQXXentHUmtxT0kp2huU7j mdsn5R+mZ+G+jd0jCoKH7HJE9pPjdguI+RW+b3zAHoVzKk5VAPW3iq9hlI5eqMHIAgww vIyvP/H+Z80MCITVovRHiVJr39zrd+YwNWPedOfXNKmkQeHjhbnlQWkQrlfd0UeoD5Uh Y1b8dv2tKVWVpMTqzh3abyQ4aAiwGINp7UO8CPZxJvRJWiIhrs3H1r0Iw7c58nfcWRcT TLJQ== X-Gm-Message-State: AOJu0Yz8otHT58iOAf1/B9mprRmf6gqapRLq53sF1CrD3hgkZFKY5XjS urhaOIWYgR5Fk8ZRYpCUeEIlo3CmYQdWztDBUak= X-Google-Smtp-Source: AGHT+IG/dz8yjin6Rfo9yPCrt+0fSyoZfN2PKEOlU1QMYUw1eLf5tmbAiCFaxKFz/1dBtugMUEKn/Y6GpzIBhBuUZYg= X-Received: by 2002:a05:6402:b7b:b0:547:da7:9c10 with SMTP id cb27-20020a0564020b7b00b005470da79c10mr2414753edb.2.1700690011788; Wed, 22 Nov 2023 13:53:31 -0800 (PST) MIME-Version: 1.0 References: <04DC3709-3B46-41C0-976E-E6AB28BC0D34@edison.tech> In-Reply-To: Date: Wed, 22 Nov 2023 18:52:53 -0300 Message-ID: To: "G. P. B." Cc: Mike Schinkel , Jakub Zelenka , =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= , PHP Internals List Content-Type: multipart/alternative; boundary="0000000000000699d2060ac4c0b0" Subject: Re: [PHP-DEV] [RFC] [Discussion] Resource to object conversion From: deleugyn@gmail.com (Deleu) --0000000000000699d2060ac4c0b0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Nov 22, 2023 at 2:08=E2=80=AFPM G. P. B. = wrote: > On Wed, 22 Nov 2023 at 07:36, Mike Schinkel wrote: > > > On Nov 21, 2023 at 11:33 PM, > > wrote: > > > > What is the point of a major release if we cannot even do such a BC > break? > > We don't even know when PHP 9.0 is going to happen yet. > > > > > > I have been using Go for about four years now and it seems they have > > gotten the backward compatibility issue nailed, and that pays great > > dividends in developer confidence in the language, i.e.: > > > > > > > https://www.reddit.com/r/golang/comments/17v4xja/anyone_face_issues_when_= updating_version_of_go/ > > > > They recently explained in depth how they do it: > > > > https://go.dev/blog/compat > > > > Also see: > > > > https://thenewstack.io/how-golang-evolves-without-breaking-programs/ > > > > Although Go is compiled and PHP is not, I think there still may be > > significant insight that can be gained for PHP by studying how Go is > > handling it and applying any lessons learned. > > > > Go is a "new" programming language, with its 1.0.0 version being from 201= 2. > It was also designed from the ground up. > > PHP on the other hand wasn't designed, but the language grew organically, > and is 28 years old. > Comparing it to Go, in my opinion, makes no sense. > > We should be comparing ourselves to languages of that age or older, the > most famous example being Python, which did a major BC break between its > version 2 and 3. > But Fortran, C, Perl (with Raku), and for sure others have all made chang= es > to the language, recent or not, that break compatibility. > > Go even has a cave out that they *may* release a Go 2 specification, whic= h > does not guarantee any backwards compatibility with Go 1. [1] > Even if the current lead engineer says this is "never" going to happen, t= he > cave out still exists. > > More importantly, it is possible to write cross compatible code, even > without changing anything about is_resource(), if we convert streams to > opaque objects. > It might be tedious and one might need to have redundant instanceof check= s > with is_resource() if one does not want to check for a false return, or > duplicate checks for closed resources. > But it is possible, which was *not* the case for Python 2 and 3 as it > changed fundamentally how strings behaved. > > Finally, I think people would have more confidence in the language if it > stopped coming with various foot guns included that need to be explicitly > kept in check by using external tools such as static analysis tools, or > code style tools. > And removing those, or making the language overall more coherent and > consistent, requires us to break backwards compatibility. > > Sincerely, > > Gina P. Banyard > I sympathise with both sides on this topic. As a Software Engineer, not breaking 10-30 years of BC promise is unsustainable, but as a PHP user BC breaks have a heavy impact on legacy codebase written 10~20 years ago. A lot of discussion has happened around this subject, but unfortunately no consensus is ever reached. I've talked about increasing the stability and the pool of maintainers by providing PHP Packages under PHP namespace ( https://externals.io/message/120335#120354). There were a lot of discussions on language evolution and editions that ultimately didn't go much further. Given how much time has passed and how this subject is always present, I now look at this with the optics that both PHP internals devs and PHP users suffer from the same condition of dealing with legacy. Between 1990 up to 2010, give or take, the way software used to be built vastly differs from how software is built today and these old software can be very hard to decommission given their lack of automation tests and inability to be statically analysed. With today's practices, I believe it's easier to introduce BC breaks that affect software written after 2018. And since I believe that, it's a natural consequence for me to believe that if PHP introduced a new `declare(backward_compatibility=3D0)`, it could be used fo= r users to signal to the engine that 1) we're writing this file after 2023 and 2) we will cover this file with automation tests and/or static analysis tools. PHP Internals wouldn't need to make a huge big-bang BC break all-at-once. Every year new BC breaks could be introduced affecting only the "new engine version". The idea isn't to build several combination of "PHP Editions" as it was discussed in the past, but rather to have a consensus between PHP Internals and PHP Developers that a new Engine is constantly being developed, this engine will break compatibility with the past 20 years of PHP whenever PHP Internals manage to rebuild something (throughout multiple versions), a migration path assumes users will use of Rector, Static Analysers and PHPUnit and the old engine keeps the BC promise in order to allow old software to keep running, but is expected to degrade in performance and to only support new stuff if it has no added burden to internals. When such assumptions are made about userland, the concept of what's an acceptable BC break should be skewed in favor of helping PHP Internals. --=20 Marco Deleu --0000000000000699d2060ac4c0b0--