Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120810 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3184 invoked from network); 13 Jul 2023 19:34:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jul 2023 19:34:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6594E180382 for ; Thu, 13 Jul 2023 12:34:07 -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: AS29838 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (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 12:34:06 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 6B9123200928 for ; Thu, 13 Jul 2023 15:34:05 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Thu, 13 Jul 2023 15:34:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=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=fm3; t=1689276844; x= 1689363244; bh=1Q8By+OQKQr9447y8KXKzQJIpRTyLDP1RBl3Qk5+L9o=; b=L nZvO6k66S/O1vgpJj1i4UgwZuE7n/EKGXPCbU1abW4ICVfFihxjMPhjeKD4zZfCa UJ9sTY0Xd++/UsvJUKsMyUsu1VpSuoOuQ6D14i7iT37CJ5dC22Pqo54+de1H8KpT LVBYaaEllUQeXYBEPTlEQ+xz4NgVPMKAQbffbhhvCkhAVBr0q3qqasvZDeQDUnrv I+dX9T1Tu9JxmjD3EdfLMnWU5NJw4irGhtb2ZLYtqPy28b2Rcq9n25uan1gE2nB4 A35u5zYT5usJtZHq22gtI4pb0OoDfh9LAcl/BAR1UOd07legft3raqbYfG466dCC ch0djV5UpHqjroCbAHNCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm3; t=1689276844; x=1689363244; bh=1Q8By+OQKQr94 47y8KXKzQJIpRTyLDP1RBl3Qk5+L9o=; b=MRECMYZBgaMURkZXxeCP/YpFVHJVq ui0lAuixaZSgNc9Ytt8wcBD5/cs1fVkZ9C8xM+2ifYFht4SjcjkMHdgf6IgryF+x EIpLe4o7fhESgHTUc9UdqrPT62YB1ZZJt8tMR6+ZR2fP6dzyT9KqMZ/LIArKqvnv a5ST1AllBYhob9gWguHdT+jREvlibJHs53/GRRyHFh7q92ke4Wg0cdIFs1DnfcMp xpSSiwcjlV7v5XMCpLBSeQz+KOkfGsM8OkDF99vEJCeLAZsqCrzup/KMsYNwJw9L ElQlWmiKumf3iJyYTWo1egBxahubH6yrW1SWUI/oEg29FqT12kKgEnzqw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrfeeggddufeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 80A211700096; Thu, 13 Jul 2023 15:34:04 -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: <6f4d0bbf-0688-42ae-b71c-e20d3d4a1fce@app.fastmail.com> In-Reply-To: References: <18e1c012-818c-44ee-ba95-c000860ac390@app.fastmail.com> Date: Thu, 13 Jul 2023 19:33:41 +0000 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [VOTE] Interface Default Methods From: larry@garfieldtech.com ("Larry Garfield") On Thu, Jul 13, 2023, at 3:09 PM, Robert Landers wrote: > I just want to say that between all of you, I get this feature now. > > Maybe someone should open an RFC where your vote doesn't count unless > you provide feedback on the list. (ban drive-by votes) > > We may not have the power to vote, but we can open RFCs. Since a few people commented something to the effect of "if we're going to do this, we should go all the way to multiple inheritance for realsies," I decided to dig into that a little further. I surveyed 14 major languages: C,C++, Java, Kotlin, Swift, Rust, Go, C#, Haskell, TypeScript, PHP, Javascript, Python, and Ruby. Of them: C++ and Python support multiple inheritance via extends mechanisms. Java, Kotlin, Swift, Rust, and C# support interface default methods. Go is weird, because it doesn't have inheritance per se, but its type composition system is almost multiple inheritance if you squint. And because it has structural typing, you can provide a method that applies to type A, and if type B uses type A, the method will work on B, too. So... it kinda sorta does interface default methods if you squint, but it's kinda squishy where you draw the line. Haskell has type classes, not interfaces. Type classes are not the same thing as interfaces or inheritance, but effectively allow for functionality equivalent to interfaces with default implementations. The syntax is quite different, but the basic concept is there. Typescript has mixins, which are not quite multiple inheritance since they happen at runtime, as far as I can figure. So, maybe they count as multiple inheritance, ish? Javascript has nothing, because it barely has a type system. Ruby has "modules", which I think are roughly equivalent to traits. Based on that, I would conclude: * Multiple inheritance is not a fringe old feature that has been left to the dustbin. A majority of languages surveyed have multiple inheritance in some fashion! * Of those that do, a majority of them implement it via interface default methods, or their approximate language equivalent. So it seems, based on the data, that this RFC *is* multiple inheritance, done the industry standard way, and multiple inheritance done this way is pretty common to the point that by not having it, PHP is in the minority. So if you want "multiple inheritance done right", that's what this RFC is already. I hope that helps clarify the context. --Larry Garfield