Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126737 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 0BBCB1A00BC for ; Thu, 13 Mar 2025 16:07:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741881917; bh=6kL0HYi2ASxyn6u377QYgYbJpqv9PmxmiIQYr5215UQ=; h=Date:From:To:In-Reply-To:References:Subject:From; b=k0HLkCcFeC2DyJab4rdjUUK8VY6PVbxZ1C6RCnmap/CSY9/HelCk91KCZDpcwkDuB Lahu+lAzvgmTaCwewPE3uqpHAqd2+GZa90+bE8wrPtStDL/zKldXZBE/ovtlgqjhqX Zb8dXRyuUwq49x9kPyXU7PIyxZ0FqnuVdkq8TvbKDDmR0RexTx1c5MgardA+JdT8sa XlUThdZcucVllwACHapwj3RLFpr2NeLyaUc3wFqsRZsgWcVORGhv+cHkvLT6on7zuO +cMw1lS+psHMU9WgZp9SR/591I3com4lJWDXH/c69QvdYys6VPTE3CMy/phgcjG2Gi vw4t1cC2rmY2A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F3DAF1801FD for ; Thu, 13 Mar 2025 16:05:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE,URIBL_SBL_A autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-a1-smtp.messagingengine.com (fout-a1-smtp.messagingengine.com [103.168.172.144]) (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 ; Thu, 13 Mar 2025 16:05:16 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 9A5E01382D6C for ; Thu, 13 Mar 2025 12:07:49 -0400 (EDT) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-04.internal (MEProxy); Thu, 13 Mar 2025 12:07:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm1; t=1741882069; x=1741968469; bh=HZJEzyT5HkwxHOKgM2+fx ZD2jidJkDR2vkE+Xwz6osE=; b=XkoaAhZ6j5Wpk5t6cDJp9j0brMSoyqYNIRI6D jH+RI0n7XQ72OUzGGmslUhaEsVt7DK0Vd7Vi227rO9VkoKXKx2LyqUlOQZPoSiqg PPpZZjXEWbN7nN3P6QMHCnBoF+Pt4JzxwXKZcj0HhQNYBwbd2XIP+BMndn51td51 7lr99wAdFYZoFEEC93SzEchifRh6j7jn3cUvqdWmKq34O8jMqOCCtWoC6uocJOF4 +XIvXp8DnWp3mKalSRlDfiF/XElLnwOf4GHd4NQwhOrLLK725I9EZI37x/nf6vrC 5oD1hEPL2NxfXhkwD970f4mkkDu1+wFUSl48PmvAOD7MnQwug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1741882069; x=1741968469; bh=H ZJEzyT5HkwxHOKgM2+fxZD2jidJkDR2vkE+Xwz6osE=; b=z0wXASx9u30Sg5qZF 4OHcBEj8u8R4ltUTY6Urm5tWJ/9i9HN6Q8Oi/PlnnnFpX20jckngt0KKAltBT1af LgQa03X9zxSgiH0GTk99fgLpStmQY06xJZoawJHBcjxVGJ2F56miS/kEOZzikQe7 CfP3hviceufrpq+biHHwQOWll46tKBaYEGjGkzGg5T40ZlmBoa5wZbHEmngX1ASV 0NBNP5hPp1cfSPGphJ3Sf03rR+9QOMVE0t8Hh57cd4VC34XISSCfi9Hapa3k1I/+ YpKdVZKU9rSX7yXYkiyg3bxZyWsIciovykkxJUxsKSqx63Qrn82/TTPw69cX1kBJ 1eRZA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdekfeelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthhqredtredt jeenucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrh hfihgvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpedttddtfedvgeelvddv tefgvefhkeevhfehieekudeggfeigefhfeduhfetgeetkeenucffohhmrghinhepthhhvg hphhhprdhfohhunhgurghtihhonhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgv rhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 5530929C006F; Thu, 13 Mar 2025 12:07:49 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 13 Mar 2025 11:07:28 -0500 To: "php internals" Message-ID: <5ba3fedf-162f-425b-b5f6-01d2d1b9fcaf@app.fastmail.com> In-Reply-To: References: <3e35cd25-c851-4ecc-8a1b-102dadb226e5@app.fastmail.com> Subject: Re: [PHP-DEV] [RFC] [Discussion] Never parameters Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Thu, Mar 13, 2025, at 10:35 AM, Tim D=C3=BCsterhus wrote: > Hi > > Am 2025-03-11 22:45, schrieb Larry Garfield: >> We should not block this kind of improvement on the hope of generics.= =20 >> Worst case, we have this plus generics so you have options, how=20 >> terrible. > > In this case, I agree. This is an obvious addition to the type system=20 > that uses the existing infrastructure of the type system. > > But generally speaking, having too many options is not a good thing. I= t=20 > makes the language larger and more complex to learn, requires=20 > documentation effort, support by IDEs and static analyzers and similar=20 > things. It's definitely a balancing act, yes. TIMTOWTDI definitely has downside= s, but at the same time, having multiple ways to accomplish the same goa= l isn't inherently wrong, unless they conflict with each other in some w= ay. >> Rust-style associated types would probably work as well. I'd be fine=20 >> with that approach, too. One could argue they're more valuable as a=20 >> sort of "junior generics," but absent anyone able and willing to=20 >> implement them, again, worst-case we end up with options in the futur= e. > > =E2=80=A6 so for associated types, I do not necessarily agree. They se= em to be a=20 > strict subset of the functionality enabled by generics, or the=20 > functionality enabled by type aliases combined with =E2=80=9Cinner cla= sses /=20 > inner types=E2=80=9D. Since introducing associated types would bring e= ntirely=20 > new syntax and semantics to the language, it is less obvious to me tha= t=20 > they are a useful (intermediate) addition to the language. The counter argument here is that a number of languages (like Rust) have= both generics and associated types, so they can coexist and serve sligh= tly different use cases. I have not used Rust enough to have an opinion= on how and when to use one or the other, but having one doesn't seem to= impede the other. From my (admittedly limited) understanding, associated types sounds rath= er like the "inheritance only" pseudo-generics that Derick had proposed = for collections last year, in a more general form. (cf: https://thephp.= foundation/blog/2024/08/19/state-of-generics-and-collections/#collection= s) --Larry Garfield