Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110253 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30783 invoked from network); 22 May 2020 17:10:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 May 2020 17:10:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5F72B180546 for ; Fri, 22 May 2020 08:49:30 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 22 May 2020 08:49:30 -0700 (PDT) Received: by mail-lj1-f176.google.com with SMTP id c11so11047329ljn.2 for ; Fri, 22 May 2020 08:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O+lPw6OhvBDo0hvTkq6zk+lB0L+Ju4DYF6fVG7+iHjU=; b=CuwryOcu+cWpMa7iznbHLgbL54YB4pjR6vb/4w+Dg2rZs1eeA//hjhdfD9xnYi3rDI P1J/QjSEMrwbyxqO6v8hzaRYJklhPGD25wXICoj8C3mUwUnBnFTTkLCEYkbZCBWaOxV0 Xe2MaHuSTjklkYcerVdRhn+Iat0hWeed+LKKHmBzd01bbyYQ/I+GBNWAIINcH/gqGFyZ j8LPd+skg+YHtps0l0LNZ41g9Rl2E2gUK9G+OR40WRDUvn8/7xyw59p6XMrwKOb4UGhJ JiZzdSZyPdGx9BQPi7CaOwazz3nq1B7MWfxQrvoUyfoVsJRl+Q2v3r9XngmYRhVBueCj 0fmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O+lPw6OhvBDo0hvTkq6zk+lB0L+Ju4DYF6fVG7+iHjU=; b=NY45kWwVaZwPaXiCYd7N2LHqLTit1oFl9vzqq8C15UPgBnAID2Zejsqz6DXOkoWkJS JeF/j1aXnHJWA9dW4jKz1lenMrVqW4CzigVE9wS2cB3pQbYQDNbMv58kHwvQLVSYQVCU afC5cZrRNzZhQaJ+5SW+0LVPCq7tspsldW8KHYxTvZhrbW/qGSMI+jXOo//5OdJ9O6SZ dngkHIlHUxCxuU3BhGTSTu5HA2YZOoblGMiQkiv5ToXFaNPi8R5G9kxLfa63TiDO9ZVQ xj/xH0aDiy7BChU2vIKU6vzUrA3413PgZuz2ynmn6PfgtX1ozpYHKe7OczQL2KV6VOuH YUYg== X-Gm-Message-State: AOAM530WsjgUyChd+fyxMDiA4+ta05pzlksiggFQ2ZS2toOeT++jwDWX bRoxKIiP1Hsn57I7vpfUN8k2nkJLag9IzfovHiY= X-Google-Smtp-Source: ABdhPJzS4ryiYrBTw9h4kHEMIgRhwFKhtA3ZA8h1YsBhq57gOUNDwfr7n0N7ODQqXbqLiVtUfflT55Wy7y3AL1Wi3G4= X-Received: by 2002:a2e:7c17:: with SMTP id x23mr5359822ljc.307.1590162566832; Fri, 22 May 2020 08:49:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 22 May 2020 17:49:10 +0200 Message-ID: To: Benjamin Eberlei Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000ee676005a63e9278" Subject: Re: [PHP-DEV] [RFC] Amendments to Attributes From: nikita.ppv@gmail.com (Nikita Popov) --000000000000ee676005a63e9278 Content-Type: text/plain; charset="UTF-8" On Fri, May 22, 2020 at 5:29 PM Benjamin Eberlei wrote: > > > On Fri, May 22, 2020 at 1:08 PM Nikita Popov wrote: > >> On Wed, May 20, 2020 at 7:08 PM Benjamin Eberlei >> wrote: >> >>> Hi everyone, >>> >>> the Attributes RFC was rather large already, so a few things were left >>> open >>> or discussions during the vote have made us rethink a things. >>> >>> https://wiki.php.net/rfc/attribute_amendments >>> >>> These points are handled by the Amendments RFC to Attributes: >>> >>> 1. Proposing to add a grouped syntax < >> >> 2. Rename PhpAttribute to Attribute in global namespace (independent of >>> the >>> namespace RFC) >>> >> >> As was mentioned in one of the previous discussions, we expect that PHP >> is going to ship more language-provided attributes in the future. With this >> proposal we have the "Attribute" attribute, but I expect we'll at least >> have "Deprecated" as well, and probably also something along the lines of >> "Jit" or "NoJit". While I'm happy with "Attribute" living in the global >> namespace, I don't really think we'd want to introduce "Jit" as a class in >> the global namespace. The name is simply to generic and does not indicate >> that this is part of the attribute system. We'd be forced to go with things >> like DeprecatedAttribute or JitAttribute, which seems rather non-optimal to >> me, as we're just reinventing namespaces to avoid using them... >> >> As such, I would suggest to introduce a common namespace for all >> attributes provided by PHP. This means we'd have Attributes\Attribute, >> Attributes\Deprecated, Attributes\Jit, Attributes\NoJit etc. (I'm also okay >> with the PHP\Attributes\Deprecated variant, but that's a separate question). >> > > Deprecated would be an "engine level" feature, but Opcache is an > extension, so it can have its own namespace "Opcache\Jit". The namespace > RFC goes that far mentioning only " core symbols which cannot be unbundled" > should go into a PHP namespace, which would exclude Opcache (and its > "sub-extension" JIT). https://wiki.php.net/rfc/php-namespace-in-core > > So for me that is not necessarily an argument against Attribute in global > NS, because Jit would live in Opcache\. > Interesting point. I think this is more an argument against using a "PHP" vendor namespace, than against using an "Attributes" namespace. JIT is not "really" an opcache feature, it just lives in opcache right now because it happens to be convenient. There are long term plans to move the optimization-related functionality from opcode into core, and JIT should also live in core (and I think there are plenty of workloads that are interested in JIT without the SHM caching). Given that context, calling the attribute Opcache\Jit seems somewhat ill-advised. I also think we'd want to provide this attribute independently of whether opcache is actually loaded, because annotating functions with it would be rather problematic if it's not always available... Ultimately I'm okay with going with just "Attribute" here, but we need to acknowledge that this comes with future obligations. In particular, introducing a "Deprecated" class is a "no" from me, because the name is too generic and does not indicate that this is part of the attribute system. It will need to be "DeprecatedAttribute" (or "Attribute_Deprecated", ugh). Which also means that you need to "use DeprecatedAttribute as Deprecated" to use it. This isn't terrible, but I also don't think it's ideal. Regards, Nikita --000000000000ee676005a63e9278--