Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121376 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 26458 invoked from network); 18 Oct 2023 11:02:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Oct 2023 11:02:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8FEC018050B for ; Wed, 18 Oct 2023 04:02:02 -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=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,FREEMAIL_REPLYTO_END_DIGIT,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 18 Oct 2023 04:02:02 -0700 (PDT) Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-d77ad095f13so6801312276.2 for ; Wed, 18 Oct 2023 04:02:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697626921; x=1698231721; darn=lists.php.net; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FjWgkA5pJzOBpaGEV5zwZ6L7E53apZHl/+uXAL1DG/s=; b=feO8CHdeZLZkSbP3Jhejaac7308PMvzqpkQMbfIdZDN0tYiDXuKj06ckdEoypvMKKm BELkxWkp32YUFeKmTpcSNdekUlsUnXxaTUdDGTOdHMQeoY0f1rztMbUuGCI6NvWZj1Df Avr82x6reCucweisaElNEZWhTTorlo5t6SyVyiQ6lxIYhcc+rbVF+QwlGE9SxrVzRrtd G7JYyRyCJtVDLVQGj1erfs8WHxG9K2h8sy44RfhyE6VmRFLSZgN0xlBxDBNL7qCwju0W BXfWYD/rCDYagAKVZA4nHRM4oZtdxGYngrtQAq/NeNseZQyjtGKxOed+LZ4RleRlz4WY QGlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697626921; x=1698231721; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FjWgkA5pJzOBpaGEV5zwZ6L7E53apZHl/+uXAL1DG/s=; b=GYZiStaJODoz4/id2JtckvL6TH9xKTh05JpPYQSkE2ATY79drd9xyZKFsr3zdLxsx/ 68nTbH9ZRqxKZpDYQZWtUarxOYBgVXtlI+mfwUoeJtn2usXm3uKCh0W4pkW3ZHBqR/BK I1vVDnAYFEgbmSIEnprihb1IUgjf7cDwDUVaJkJRvxgCLIyZ01nGXjqEmANWUtEGVM98 PiKGVH3zTSbtX5IUt7DpPMo8zmiIfdCFAQw/tUEIVgRtOSW/6oDAG63KBFeyUI+bj4qp /0fxsk/mbyWsXp7FNcjhHKNbMMDMVaeh3akoo5PX2YIDAzBprG5Pp8iAS0cUguGcblAM FcFg== X-Gm-Message-State: AOJu0Yz2V9YwupCWeWdKeHiSIzj3A1MfJc3mWnKO+CpLuBedn51cysqt 4HOGwMn14k4IzoaWOsSAscIyZFxBoY0I5UHGLFE= X-Google-Smtp-Source: AGHT+IGQ3z5D9w2NkUMGziq3Ju5atbXBrq67adYNEBhUgOZUXJBXTpljv+Iu7zusfSbDgDnHC+b2lS7Nehl37pgeqqY= X-Received: by 2002:a25:37d8:0:b0:d9a:628e:9933 with SMTP id e207-20020a2537d8000000b00d9a628e9933mr4227219yba.60.1697626921020; Wed, 18 Oct 2023 04:02:01 -0700 (PDT) MIME-Version: 1.0 References: <9d5388fa-a5a5-4fa5-81ff-16f6670f80b6@gmail.com> In-Reply-To: <9d5388fa-a5a5-4fa5-81ff-16f6670f80b6@gmail.com> Reply-To: autaut03@gmail.com Date: Wed, 18 Oct 2023 14:01:49 +0300 Message-ID: To: Rowan Tommins Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000096c3740607fb91a5" Subject: Re: [PHP-DEV] Previous discussions about generics syntax only? From: autaut03@gmail.com (Alex Wells) --00000000000096c3740607fb91a5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Oct 17, 2023 at 10:40=E2=80=AFPM Rowan Tommins wrote: Using the same syntax for type information that is guaranteed to be true > (existing run-time checks) and type information that is "advisory only" > (new checks for optional static analysis) means users can no longer have > confidence in that type information. If "syntax only" solution was temporary then warning users through some kind of opt-in mechanism (like with strict_types=3D1) may be enough - that way users will know that generics type information is "advisory only" and that this might change in the future. In some other languages (Kotlin) there are opt-in mechanism for experimental features - ones that are possibly incomplete, unstable or non-final, and it's working quite well for them. On the other hand, I can see a "third way": if the problem with current > static analysis conventions is that they have to be parsed out of a > string-based docblock, we can provide *dedicated* syntax, without > unifying it with the standard type syntax. For instance, some of the > earlier discussions around introducing attributes suggested reflection > expose the AST of the attributes arguments, rather than the resolved > expressions, allowing them to act a bit like Rust's "hygienic macros". > If that was added as an optional mode, you might be able to do something > like this: > The community has just now decided on the PHPDoc syntax for generics, has just started widely adopting them in packages and has just got first-party support from PHPStorm. I doubt that migrating to yet another temporary solution (one that still doesn't address all of the concerns) is a good idea right now. --00000000000096c3740607fb91a5--