Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120798 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16864 invoked from network); 12 Jul 2023 18:17:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Jul 2023 18:17:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 920E7180382 for ; Wed, 12 Jul 2023 11:17:22 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 12 Jul 2023 11:17:22 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id BD68C5C0114; Wed, 12 Jul 2023 14:17:21 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Wed, 12 Jul 2023 14:17:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:cc:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1689185841; x=1689272241; bh=R633WjdjvO2wWC8IHAmVOYu7dEwPdd7atRa surGFBE8=; b=hkDEhBBxDKMHuC/BS+ZL3t/Bxs+3ItVwAKrhs836SyLXBMxiNPK gMGtPFbAwK9O+BXvWbGkmaKhUhGAiWGSq4gbvTKjnCVw/67h3mWOToSwHGtzzDlx Ilgj+4HkkX4SOdy0vCAeUI6xICHbo0QvMOrdUof4fmkSquuid1bgoHODBlmBfHpl nUzgbZyi2dmouxddyzaDmWDcuH8r59ZrCC0Cbm/99g0BzmWvJmsnjXTJQmfmCTpL EoC/h+SF69u5dAE27B6lCiaN7GRxjGxt5Mt47YUU9TCybxIEORpxSCFUzK92/wnq lW5i3dchucdS2Se0kFBz38OxXgsw+fwOIRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1689185841; x=1689272241; bh=R633WjdjvO2wW C8IHAmVOYu7dEwPdd7atRasurGFBE8=; b=Wro4Nh+AzOanQuFXa+AKIeDMmdx89 teZ/bMS3rpcIzarUjiOq/4lmKFsYWdo5UqfWv0VN0eV5ILF/7q9B9D8le/P2UHQ4 MRH8IJIUAk3BJHaDXISkwgJUaVCLf0p+y44fnXSimb0azbNwsvI66F0vHnAH/cIg B4YcNAfM0TpHFYL+yGkj4fDpCyJI927C3vxg2nWk7rhQVHtVuOPGQzPUP2Q51vml blw2srEX1abiK3b1ApqOSn3fH/0B44wO+xQCdp64B+0r0nyBH/AJAm6+0MncTLxI 5HHqIfMhVIqZTyyGqTC5IBAH91PbV1SWFzeuROdp09S2+SXySCuF/biFw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrfedvgdduvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepheduhfejfffhgfevfefgvdetueevheeggedvueeh vdduudeflefftdffvdelieeinecuffhomhgrihhnpehphhhprdhnvghtpdguihhoghhotg grshhtrhhordgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6669D1700096; Wed, 12 Jul 2023 14:17:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-531-gfdfa13a06d-fm-20230703.001-gfdfa13a0 Mime-Version: 1.0 Message-ID: <18e1c012-818c-44ee-ba95-c000860ac390@app.fastmail.com> In-Reply-To: References: Date: Wed, 12 Jul 2023 18:17:01 +0000 To: "G. P. B." , "Levi Morrison" Cc: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [VOTE] Interface Default Methods From: larry@garfieldtech.com ("Larry Garfield") On Wed, Jul 12, 2023, at 4:00 AM, G. P. B. wrote: > On Mon, 3 Jul 2023 at 01:11, Levi Morrison wrote: > >> 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. >> >> Thanks to everyone who discussed weaknesses in the RFC during the >> discussion phase. >> >> [1]: https://wiki.php.net/rfc/interface-default-methods >> > > 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. > > 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. > > 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/ > > 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. 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. At least, I know that description applies to me, so I'm assuming it applies to at least some other folks around here. :-) 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. 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. 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. (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.) --Larry Garfield