Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116060 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 67014 invoked from network); 17 Sep 2021 07:52:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Sep 2021 07:52:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A8C611804F2 for ; Fri, 17 Sep 2021 01:32:52 -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=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,URI_DOTEDU 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-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (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, 17 Sep 2021 01:32:52 -0700 (PDT) Received: by mail-oi1-f178.google.com with SMTP id n27so13081087oij.0 for ; Fri, 17 Sep 2021 01:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=EwuAZKP61AWv3FOuZrroeNcESPVbNGnwcZ+aNwFcj0c=; b=mRmILJD3l5HXi/3DB43RMFszlDKzgjUiC8MMN3nQ2fE4NXI/Kk5v27Ohl1iOoIkioF 5xu5NTXz832qenqkFAAJ0i2eaqxfO2k51q/+bZH6+VHTrYW7/H7tlBfMpjx9C+VHqg34 iLLitpIhHLhmYOetyEXHfnWZZjQMB1yTRM/ZpmZnUAh2USmDzxXGMqgI2/ogLJFhMNSq xd3yv+IB2uiLMfPsCpn1CdazXvt9c+Pb/Mi2VBHL1ObOeEH7YD2xVvo4uN3P561fBu8z 7welnxqGRGIk7Hu1GkTPTookdF7rfFeFgyxJDay3RuOVlnBv3dOOrNpdazTA8obfzeb5 cEaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EwuAZKP61AWv3FOuZrroeNcESPVbNGnwcZ+aNwFcj0c=; b=l/ZbXoA1W944MDcXdp4cTf52o8kKfXdXnxsKdVwbs0HluyiesPFd62YQfeaxJjnw9L ZOFBo9HhMe6kfSTQ/tnD4viiJjmDj7tYfSngnh8/9ze6JriIdw4OQNpE4dln6uzbd1DF hQFatSsscqXp9vDyLDnBUFuX//lKP6Kd4oOFQ9Bcwun5tm59nKSaEZuulZeH/6hyLGH4 fWtiLhM+eivj8UJrE9zJOgzx1d9GCgRkPTQig3kpcN/X5NqNI+iV2piVmMgqT3D21oQk JpEoi+gbjuA12Ek7qmVARqH5FNL31662YI7OF5RqUQVMKbVbEosRUpj1E0lXpvSBYHD/ P+Ow== X-Gm-Message-State: AOAM530ADxLFWDZMQQf5GM+TJ2zftMtu+KGomMgEHmO4N24FcKFNXc1j SodqRJSMwyAbskXyHQZZJMzANCFL+Pdc/AN/cdXLiRR3nKjn0A== X-Google-Smtp-Source: ABdhPJw7mE5hfPiOWFOvZlnIZfSxGgAHLl9Tt3qF4J41RcEtselZUOoAtS+efJvQUPA4IlutuYULhZ0tyrjIk+RRUkE= X-Received: by 2002:a05:6808:3d9:: with SMTP id o25mr3039292oie.168.1631867568403; Fri, 17 Sep 2021 01:32:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Sep 2021 15:32:37 +0700 Message-ID: To: Christian Schneider Cc: "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC: Add `final class Vector` to PHP From: pierre.php@gmail.com (Pierre Joye) Good afternoon Christian, On Fri, Sep 17, 2021 at 3:07 PM Christian Schneider wrote: > > Am 17.09.2021 um 04:09 schrieb tyson andre : > > I've created a new RFC https://wiki.php.net/rfc/vector proposing to add= `final class Vector` to PHP. > > > First of all: I don't have a strong opinion on a Vector class being usefu= l or necessary. > > But I have two comments about this RFC: > 1) Using the very generic name Vector without any prefix/namespace seems = dangerous and asking for BC breaks. > 2) I don't like that this class is final. The reasons given in https://wi= ki.php.net/rfc/vector#final_class seem unconvincing to me and restrict the usage of Vector in a way whic= h makes me question the usefulness to a big enough part of the PHP communit= y. > > These two reasons combined would make me reject the RFC at the current st= age. I think it is more in a draft stage for discussions. To be more precise with my earlier reply, I only see such additions as useful if it is an actual Vector as known in other languages and widely used the last years in ML and other similar areas like data or image processing. To me a vector is useful if it allows vectorized operations, as in SIMD, AltVec, CUBA etc. Some refs: https://users.ece.cmu.edu/~franzf/teaching/slides-18-645-simd.pdf https://indico.cern.ch/event/238763/attachments/401939/558861/HP-intel_mic_= optimization.pdf These two refer to Intel architecture but ARM (especiall v9 with Neon, MIPS, ppc and maybe soon riscV does support such operations as well. It is amazingly well suited for raw performance increase. I can imagine having annotations and/or specific optimization for vectors of scalar processing. It requires a bit of (re)thinking, but it is totally worth it. Generic multiple data types vectors are less useful for such things and SplFixedArray does it already, if I understand the RFC, as it stands now, correctly. best, --=20 Pierre @pierrejoye | http://www.libgd.org