Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125053 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 746251A00CA for ; Mon, 19 Aug 2024 21:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724102464; bh=vVW9mAqlbgBlcSFWn9KVS9W4AyXWyE9H7uSNTopsUQQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=bF4pTQNC0GSNmZ2Z4Sa02Kk36AMWAsP8DV1Cnq4p5khqdlNv1JjjTBf1o/KyoRv53 rkxEpr5Hp5CzzBwVTKMLWiAqMl2eRsYDBuEoo1HzYJsLvhZKWWOMt7BqcOufGGnIq7 Z8QBwVPYIV07ZQh+qv5EprcAO9+IBee6MEIb+xSdW4yRWKlxH2PXutX+GLzbfRcS+w XOiX/R3f3M8/JV3q1xcemagkbB9AKs+Tpfdte3hW53Fbsm6YdveO+fIBJJ3mUBB77W OX5PQjdCiDV1en4/6qOZWovR1e6C35y3XCnDFTZZiebQA6uevu1aEXPfKUsf9BiG3W q8yvgiIUcXBvQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9BC75180072 for ; Mon, 19 Aug 2024 21:21:01 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 ; Mon, 19 Aug 2024 21:20:55 +0000 (UTC) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-42809d6e719so40036835e9.3 for ; Mon, 19 Aug 2024 14:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724102345; x=1724707145; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vVW9mAqlbgBlcSFWn9KVS9W4AyXWyE9H7uSNTopsUQQ=; b=OHw/YZosgUGO6kZps+1MCtiNef4gkFDGNfC7cXIcL6R/+qGqlWJrhQn2XCwZIsH8JC LiNEoSCzYX6cZ83N6T1uHwqLujnY6RRgVKfG7mCtyclDAk1lDoNL+wRakTVdaCDOw4be K4iKbwikLNyOvsr3wR0fnGC5xarSd7FN8TMxLPO0c2IDRFRjwgmiV8xAxMVTPCAc639J 1Zv0v9Z3VWSGQcAZE0h1w9LGJKIdih+4/eqAuoDGfh0r9WndlXzBiWh1cU0eE05rSPZg zRa2r0CudriCPbwybZMWCa5Z5OM+X3/BJbBvxncfA/cQNoGzhDOoCplVOpw5Hq/J40zx gJpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724102345; x=1724707145; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vVW9mAqlbgBlcSFWn9KVS9W4AyXWyE9H7uSNTopsUQQ=; b=Uv5eW+ocGhI5Bzb59StwDDT42V7ETEgBqThODe0TUAeQBDpPNfoE4AjK+wzlHTgXum Bzsv1iJxnnHAoZ6Raq7p+ii+Xp2MPqpwmXPMJxKHqJeyRnTuc5cHW0mXssOuGMxiQYzD dO1jt+ilM22qtWXB/HCNSHf652y1gMbB02ebFl3/RaW3ZBD8DEHjjEIx7bV9BqeaLHNg NfTfnyvKh1OKjtPZywTX0igaDIezshOMLCaR91VydVxkFOKv0RH5F/Jv6qAgUA4rG+lP 2SQS5BAita+32wg8D1B4+QsAufAWtOH/4GoW6Z3mH6XFCKS3NAeqtJRYaVzwEkfITcee HK5w== X-Gm-Message-State: AOJu0YyZqX81ZTyh6h7nBsLcu0qzx7eqjLPZH6qKBqF9+rw9vdXkhWBy x/B1nAP3V+qCvQ2THwvAXBPaqQQV49+BLZQloGn5taTuNnL0cQoSKavz+Q0NNYss0z9GxjQVdvn CapFRdlruQTyXZrjMmzhqnxKyCA== X-Google-Smtp-Source: AGHT+IEoSKnCbs/LlkQXDU3r2VviOyZxlCaUfiXrFcdkVIPA6WossWiX+uGPvUpTQ1MIPNtAEIqI3GkzbYQP/MjjsFk= X-Received: by 2002:a05:600c:468a:b0:428:6f4:57ff with SMTP id 5b1f17b1804b1-42ab6aaf721mr1518585e9.35.1724102345113; Mon, 19 Aug 2024 14:19:05 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <1b59392a-68cb-36eb-0fef-977ac7113520@php.net> In-Reply-To: <1b59392a-68cb-36eb-0fef-977ac7113520@php.net> Date: Tue, 20 Aug 2024 00:18:53 +0300 Message-ID: Subject: Re: [PHP-DEV] State of Generics and Collections To: Derick Rethans Cc: PHP Developers Mailing List Content-Type: multipart/alternative; boundary="000000000000d6486306200fdbdd" From: udaltsov.valentin@gmail.com (Valentin Udaltsov) --000000000000d6486306200fdbdd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, 19 of August 2024=E2=80=AF=D0=B3. at 20:11, Derick Rethans wrote: > Hi! > > Arnaud, Larry, and I have been working on an article describing the > state of generics and collections, and related "experiments". > > You can find this article on the PHP Foundation's Blog: > > https://thephp.foundation/blog/2024/08/19/state-of-generics-and-collectio= ns/ > > cheers, > Derick > Hi! Thank you very much for the article. In the "Fully Erased Type Declarations" section you mention that "It's unclear what impact erased types would have on reflection, or libraries that depend on reflection." I wanted to share a thought that if code is analyzed with external tools like Psalm and PHPStan, it might make sense for reflection to be handled by external tools as well. For example, BetterReflection offers native reflection functionality statically and is already used by PHPStan and Rector. Additionally, I maintain a project called Typhoon Reflection that supports phpDoc types and is capable of resolving generics and type aliases= . If PHP moves toward a =E2=80=9Cfully erased type system,=E2=80=9D it=E2=80= =99s possible that in the future, we could see tools that both analyze code, and provide reflection. --=20 Best regards, Valentin --000000000000d6486306200fdbdd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Monday, 19 of August 2024=E2=80=AF=D0=B3. at 20:11= , Derick Rethans <de= rick@php.net> wrote:
Hi!

Arnaud, Larry, and I have been working on an article describing the
state of generics and collections, and related "experiments".

You can find this article on the PHP Foundation's Blog:
https://thephp.foundatio= n/blog/2024/08/19/state-of-generics-and-collections/

cheers,
Derick

Hi! Thank you very much for the article.

In t= he "Fully Erased Type Declarations" section you mention that &quo= t;It's unclear what impact erased types would have on reflection, or li= braries that depend on reflection."

I wanted to share a thought= that if code is analyzed with external tools like Psalm and PHPStan, it mi= ght make sense for reflection to be handled by external tools as well.

For example, BetterReflection offers native reflection functionality statically = and is already used by PHPStan and Rector.
Additionally, I maintain a pr= oject called Typhoon Reflection=C2=A0that supports phpDoc types a= nd is capable of resolving generics and type aliases.

If PHP moves toward a =E2=80=9Cfully erased type system,=E2=80=9D it=E2=80= =99s possible that in the future, we could see tools that both analyze code= , and provide reflection.

--
Best regards,
Valentin
--000000000000d6486306200fdbdd--