Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120802 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66781 invoked from network); 13 Jul 2023 11:46:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jul 2023 11:46:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 342121804B3 for ; Thu, 13 Jul 2023 04:46:30 -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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 Jul 2023 04:46:29 -0700 (PDT) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-99357737980so92736766b.2 for ; Thu, 13 Jul 2023 04:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jetbrains.com; s=googleapps; t=1689248788; x=1691840788; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :from:to:cc:subject:date:message-id:reply-to; bh=X/u21P5bxoh30s+T+RcfW3YgVL3zz6wYC00wU2VElPk=; b=GitrjBOqg7O8agKSKmxYGlYtDs1I6DJc/JPZja4DDryTFUCHBgVVSIHEq/tcnK6qj5 C68DalcpGieWpDITh4jOwD/pYmotyrexDFVygupnzibCw/GsIz5OydUWQJZ8gIHHO+yc IKozBsYVnCHa9O+nopTdPrZY4F+KHaIWNMG9U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689248788; x=1691840788; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X/u21P5bxoh30s+T+RcfW3YgVL3zz6wYC00wU2VElPk=; b=HIXX9UKlXNKAD/TjIyXutDrulCQBUt7JBPIuto78sh15+ReUpufaLC6rRwO9m8nJNX 0EM+MO6dKdxiptmkjSlVT8oxhntuUjiLGJct+5lPVXaYbhx1yI+rkn7A5s4S3IvGhssy RXKgbCiC6jbylDktwrMGte3aEqKPXLbgWYx0nKaSyw7R14w529wh716j0EW3/so2oKYm 4Tfx+PknqM4aC6Sx8Z9Ecj0N/tpX18v7oUvxmrZJjIgLU6J9VnLx7VeVSKBxXME24UpG bnuaJE2NVvpS6Kjok2s+0N3F3XSrcgebnuZb6+Mti0b6NGUOnbOqM9B7bkqbZvO0azHA Pr7g== X-Gm-Message-State: ABy/qLafNhb4V0L46EtP6U9In6VUtLnOvRH9afFG9FotHgvX7sgxdGGq L3ODuktG3ffdT9HribtF8TXpXf47ckEAcJ2B7kk= X-Google-Smtp-Source: APBJJlGx/B6UQ1Ef6asAFAlHYoLv4mg0sobZx9EZFd+BT02JljL1yYC/epsSk7ee10PrG/ySSJXN3A== X-Received: by 2002:a17:906:105d:b0:993:e883:491f with SMTP id j29-20020a170906105d00b00993e883491fmr1268639ejj.8.1689248787950; Thu, 13 Jul 2023 04:46:27 -0700 (PDT) Received: from smtpclient.apple ([2a02:a03f:e32a:100:d4c9:6adb:7477:64cf]) by smtp.gmail.com with ESMTPSA id h21-20020a170906261500b0099236e3f270sm3864374ejc.58.2023.07.13.04.46.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2023 04:46:27 -0700 (PDT) Reply-To: Brent Roose Content-Type: multipart/alternative; boundary="Apple-Mail=_11D22753-1C8A-49EE-B8EC-F394D23305B9" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Date: Thu, 13 Jul 2023 13:46:16 +0200 References: <18e1c012-818c-44ee-ba95-c000860ac390@app.fastmail.com> To: PHP Internals In-Reply-To: <18e1c012-818c-44ee-ba95-c000860ac390@app.fastmail.com> Message-ID: X-Mailer: Apple Mail (2.3731.600.7) Subject: Re: [PHP-DEV] [VOTE] Interface Default Methods From: internals@lists.php.net ("Brent Roose via internals") --Apple-Mail=_11D22753-1C8A-49EE-B8EC-F394D23305B9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I want to pitch in, agreeing with Larry's message here.=20 - There are multiple real life use cases where the combo trait/interface = could be replaced by interface default methods - Several modern language apply the technique in one form or another, so = it's already proven to be valuable - There are a multitude of userland devs who'd benefit from this feature - The only argument I've heard against this RFC is "it goes against my = definition of what an interface should be". I was also thought that same = definition, and I also had to unlearn it. Just like I had to unlearn the = "only one return per method rule" we were taught in college Brent > On 12 Jul 2023, at 20:17, Larry Garfield = wrote: >=20 > On Wed, Jul 12, 2023, at 4:00 AM, G. P. B. wrote: >> On Mon, 3 Jul 2023 at 01:11, Levi Morrison = wrote: >>=20 >>> Chatter on the [Interface Default Methods RFC][1] has been quiet for >>> the past 6 days, and the feature freeze deadline is fast approaching >>> for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks >>> as usual. >>>=20 >>> Thanks to everyone who discussed weaknesses in the RFC during the >>> discussion phase. >>>=20 >>> [1]: https://wiki.php.net/rfc/interface-default-methods >>>=20 >>=20 >> Although I like the idea, I think the main reason for the pushback is = how >> close this is being voted on before feature freeze when the RFC + >> implementation was updated very recently before. >> And personally I think, considering this, I would also delay = implementing >> this. >> We have at least 2 other major RFCs that are being pushed back = (Property >> Hooks and Function autoloading) due to time constraints. >>=20 >> Maybe it's time for a more meta discussion about the absurdly long = release >> process PHP has of releasing many intermediate versions that seem to = get no >> testing from userland. >>=20 >> For everyone against this feature, I would urge you to understand the >> distinction between "type classes" and Java-like "interfaces" (which = is >> effectively what PHP interfaces are). >> A good article is the following one: >> https://diogocastro.com/blog/2018/06/17/typeclasses-in-perspective/ >>=20 >> I also find it baffling the lack of understanding around this = feature. >> Generic programming exists, and it operates on a level where a method = can >> have a "concrete" default representation and still represent the = genericity >> to its fullest. >> Examples have already been given, such as the Comparable, Equatable, = or >> Iterator type classes. >> Considering, Haskell, Rust, Scala, and modern PL theory sees no issue = with >> that, I struggle to understand the resistance here. >=20 > If I could play armchair shrink for a moment, I suspect a lot of = people come from a background where "interface is just the behavior = definition, not implementation" was drilled into them. Which... is the = case in older Java when most of us went through school using older Java. = So it's natural to think that is just a rule of how languages work, and = so default methods in interfaces is just some weird nonsense from people = who don't understand language theory because you didn't learn it in = school. >=20 > At least, I know that description applies to me, so I'm assuming it = applies to at least some other folks around here. :-) >=20 > Realizing "oh, wait, I was wrong about the theory of how things work" = is uncomfortable, and hard for a lot of people. I was initially = luke-warm on it for that reason. But seeing how many languages have = adopted some form of default methods and lived to tell the tale is = convincing for me that it actually is a viable "build up a class from = separate pieces without having to manually write 50 proxy methods" = solution. There may be smaller issues with it that need to be ironed = out (enforcing methods being defined, it working better with interface = properties, etc.), but the core idea seems to be sound. >=20 > It's taken me a while to get used to going through that "oh wait, I = was wrong" process, so at this point it's not an ego-hit. But that's = not a process everyone has gone through. >=20 > In short, I suspect at least much of the pushback is "that is weird = and not normal, according to the normal I first learned, so it must be a = bad idea," and people just stop there. >=20 > (If you voted no and the above description doesn't apply to you, = please do explain what your alternate reasoning is, because RFC authors = desperately need more feedback than we get right now.) >=20 > --Larry Garfield >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php --Apple-Mail=_11D22753-1C8A-49EE-B8EC-F394D23305B9--