Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125163 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 B74421A0117 for ; Fri, 23 Aug 2024 18:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724438465; bh=HSlR4zWbaM663nYFTl106G71lU9mDTBcGXX8Oflvg/Q=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=BazCu90mbtyxMqlFlBoA8cBOF3VOowF2LIJMRTXVekO1UlLpZTJ16r1ObD27MkcRi t5hndh/LOCgoylcmcgekfepS+S+iH6rsvb2fo5gOcSYFrCNNpNxPwysWRdLIKVBnjN T/8B1knj4NgH3x0vxFMn87T5x84HoLMEIJ3FqzTfYlj9ph5wNeO6sOs5jm3Aizvu+Q BoQdhat02eRNBSRNvK3SKUFsQkxo2nVNJKe6uqnUDJOP+OMhAJ7FuW4AwDFtCBMmZ4 Kcg2YOUGURDd16Op3IgviJ+lmgmsAiYlSjnJtl+gcSRSB01oYsmH3uFdrmm/PaAWj0 b0TK0fAdNbwrg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6BE5D1804CD for ; Fri, 23 Aug 2024 18:41:03 +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=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout5-smtp.messagingengine.com (fout5-smtp.messagingengine.com [103.168.172.148]) (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 ; Fri, 23 Aug 2024 18:41:00 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.nyi.internal [10.202.2.43]) by mailfout.nyi.internal (Postfix) with ESMTP id E2CFE138FC69; Fri, 23 Aug 2024 14:39:08 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-03.internal (MEProxy); Fri, 23 Aug 2024 14:39:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:cc: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=fm2; t=1724438348; x= 1724524748; bh=WwZQ5r1uV1D/6H1pjUGhIJ3lEpJy0YNZrGtcCfBQmTY=; b=Q nV23sv75vSlWIg69uBn8+PmGv2ASoabdd+P1KYCoGXgi3SCEYqUkDRPz6/DU1mZs 7AgPn+K1ONU29ReQ6d7Bo0ca5e/IpgP3MkFqyKvWOE3p+sURvPLY8MorB668VfAk lIIpz1ug8zhHPlAgjo8VIe4U5I+Q/rV3pjSU3yCtWovFKupdPNqLK6suA5SJNit/ 7GMiB1LXiYpbIvGGXUGjuwN8jT7oPkvSgnQLGtzWaROFqMpOhtZl3h/cTsDUn5UP +3elrhCE8qZj2N9/Mn25Raww3887pzT0ncOMDHQ6N9UXTH9dzXQ/opV92nMIp0Do Nc4tilnLKhTpe/I2Ns1qg== 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:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1724438348; x=1724524748; bh=WwZQ5r1uV1D/6H1pjUGhIJ3lEpJy 0YNZrGtcCfBQmTY=; b=OjZ2F/ds0KBn+p4Y7c3Jz5EGzl3CdKwkbQMwzFBJ86fb pv1eCtQeYM9UNz0Q3P6FfhngoGz4LP0zakFrAbz3b/rab93NkETiIpH7yFGe6Fvb at6BFIRRqzNCz9Yd6UjO+UQ446HRSv2/ycPsEOF9++4BEoHo5/m/WE7XQTJCEIJ7 Zp9OmQHrELZZEK+Z1WtSsFx7kYnkECAT0o5RDueLjDKrZqttpnDAhRgmRM0Wxj8Z WSArtjgwUpK/E5NnOfM/NRQJNI3Q6vGuPAzUMeJ8WNhFBW6J2Ix+7Ku1u/GlAoex NQCOuVct6YpBEUUq/qfe3Y+vr+fr2MxDer0oP+B0vg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddvvddguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughr pefoggffhffvvefkjghfufgtsegrtderreertdejnecuhfhrohhmpedftfhosgcunfgrnh guvghrshdfuceorhhosgessghothhtlhgvugdrtghouggvsheqnecuggftrfgrthhtvghr nhephfevteevuefhjeeitdehhfevgedvvdfgudejvedukeffhfehvdfgffegvdelfeffne cuffhomhgrihhnpeefvheglhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehrohgssegsohhtthhlvggurdgtohguvghspdhnsggprh gtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeifvghirhgurghn sehgmhgrihhlrdgtohhmpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrph hhphdrnhgvth X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9CB14780065; Fri, 23 Aug 2024 14:39:08 -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: Fri, 23 Aug 2024 20:38:48 +0200 To: "Bruce Weirdan" Cc: "php internals" Message-ID: In-Reply-To: References: <1b59392a-68cb-36eb-0fef-977ac7113520@php.net> Subject: Re: [PHP-DEV] State of Generics and Collections Content-Type: multipart/alternative; boundary=6f6dd2ce0ea2429fb46b2efbab480f3d From: rob@bottled.codes ("Rob Landers") --6f6dd2ce0ea2429fb46b2efbab480f3d Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, Aug 23, 2024, at 20:27, Bruce Weirdan wrote: > On Fri, Aug 23, 2024 at 4:27=E2=80=AFPM Larry Garfield wrote: >> Moving those definitions to attributes is certainly possible, though = AFAIK both the PHPStan and Psalm devs have expressed zero interest in it. >> Part of the challenge is that such an approach will either still invo= lve string parsing, >=20 > That's not really a challenge and would help somewhat with the current= status quo where we have to guess where the type ends and the textual p= art of the comment begins. But it gets ugly for any type that has to inc= lude quotes (literal strings, array keys, etc). Technically one can use = nowdocs, but it's not much better: https://3v4l.org/4hpte > =20 >> or will involve a lot of deeply nested attribute classes.=20 >=20 > Yeah, that would look like Lisp's S-exprs, but much worse - which, in = my opinion, would harm adoption. >=20 > All in all, in my opinion attribute-based solutions are less ergonomic= than what we already have now in docblocks. >=20 > -- > Best regards, > Bruce Weirdan mailto:weirdan= @gmail.com Thank you Larry for expressing some of the problems. Is there any reason= nesting has to be supported out of the gate? Think about type hints. It= started with some basic functionality and then grew over time. There is= no reason we have to have a new kitchen sink, oven, dishwasher and stov= e when all we want is a new refrigerator.=20 =E2=80=94 Rob --6f6dd2ce0ea2429fb46b2efbab480f3d Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

=
On Fri, Aug 23, 2024, at 20:27, Bruce Weirdan wrote:
<= /div>
On Fri, Aug 23, 2024 at 4:27=E2=80=AFPM Larry Garfield <= ;larry@garfieldtech.com>= ; wrote:
Moving those definitions= to attributes is certainly possible, though AFAIK both the PHPStan and = Psalm devs have expressed zero interest in it.
Part of t= he challenge is that such an approach will either still involve string p= arsing,

That's not really a challeng= e and would help somewhat with the current status quo where we have to g= uess where the type ends and the textual part of the comment begins. But= it gets ugly for any type that has to include quotes (literal strings, = array keys, etc). Technically one can use nowdocs, but it's not much bet= ter:  https://3v4l.org/4hpte=
 
or will involve a lot of deeply nested at= tribute classes. 

Yeah, that wo= uld look like Lisp's S-exprs, but much worse - which, in my opinion, wou= ld harm adoption.

All in all, in my opinion= attribute-based solutions are less ergonomic than what we already have = now in docblocks.

--
  Best regards,
    &n= bsp; Bruce Weirdan               = ;                    &= nbsp; mailto:weir= dan@gmail.com

= Thank you Larry for expressing some of the problems. Is there any reason= nesting has to be supported out of the gate? Think about type hints. It= started with some basic functionality and then grew over time. There is= no reason we have to have a new kitchen sink, oven, dishwasher and stov= e when all we want is a new refrigerator. 

=
=E2=80=94 Rob
--6f6dd2ce0ea2429fb46b2efbab480f3d--