Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116109 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63793 invoked from network); 20 Sep 2021 13:37:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Sep 2021 13:37:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 97E911804CF for ; Mon, 20 Sep 2021 07:18:17 -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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_HOTMAIL_RCVD2, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.80.0.0/12 X-Spam-Virus: No X-Envelope-From: Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08olkn2066.outbound.protection.outlook.com [40.92.47.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 20 Sep 2021 07:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HfJlH8pvs65ZDCeAz1dAJ8M7k8zVy0gnqbUh+YvHv3LwkMyUREq1AZneuL3JlZ3pwsCldAzgmngz8tiURRW3aGHwCB92GSH0az8pv6IVUyD2Wa/8DqCYcnBnWdZZ9XvmXZTRnX5whAeygK9e+Y7elaTOB8F7aB/Mw9Zr9mDaHV7BcWC/Qg2VrrQIY1tuJ+phKBfOrs2onrwM/TXJgfy6WBtnJ3D9QpLIfZo5uKJtdpzxtbZ2xIU1K6Fr/X2MoQ3C3weZy846EalJrYdwS4kyesDTZIyjIt8hZl/uUeHZUOIkHflLFcoR76ZE5sZqwv7ngJ70/NH85oCri10tpxwBuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=D1bqbny0fpg0+nMIJY6AE7jGFHVXfv+z+dCz5UkQOYg=; b=iS/8ANNGCRZho9BJiL9tWmvbrp8lCFpCMembhn+S5ootOp7eiUxvrQygZwl4ONNsPeIYsZUzvaAPwHcGp3t4v/o9crLMu/kyCf624907wST5u0Q9tUczHORVq5AjRLRxo6X5O3bWTC+IL1fh/uqbhl1d63mYIL1p/y7QuVuQcsh0iXG7qxJ1LSErBxsYjCahqbue3l0J9ksV3L74DcXgch7GGDkPbUR5CTk1yHEk3kIe8oBW4dvlJhCfEQYBJ56MLrBXsiHFwCGW9Ar7v4Oar+yvL3nDwWmiFYt2GN9uZvcex6JdBjm6sVxu5IAP+TikkBl1JR3fn5okzdbo3mM/rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D1bqbny0fpg0+nMIJY6AE7jGFHVXfv+z+dCz5UkQOYg=; b=uj5LF7cfJgaQ/XgFRIbW639w/y9fA2pscWcgOHs211AzeCiWTzQ/GPmhA+lc/Z+E5NLiTa9ceG8LMqwofaFwUq3IdsqpiaibPfSNcyEWT+0O8TlFqQ8fGyaqhN4La977mTEd7/VQknBASxTeIoYmStGVioUTDdBxjrynKpLqe4xBNqtrRP26ejuvwfWLmXf1Oo3DAi1HSQ9s7LVhTNOFg7efg7zLP1fb3mlue0voQbmLB1qdCaltJtcox9DOnIfpAnCbBdssTmh5rlj40sEOpNVqFfKQkL2P7NrQAGKd3e3VcDZ/4PTutNTw81XJhbrwPVqjdaS3HF32JnOWzokAnQ== Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2603:10b6:5:1cf::26) by DM6PR07MB7259.namprd07.prod.outlook.com (2603:10b6:5:222::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Mon, 20 Sep 2021 14:18:15 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::7181:60db:c4d2:835]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::7181:60db:c4d2:835%7]) with mapi id 15.20.4523.018; Mon, 20 Sep 2021 14:18:15 +0000 To: php internals Thread-Topic: [PHP-DEV] RFC: Add `final class Vector` to PHP Thread-Index: AQHXq2Dr5ROExEhu802SAlX6zd1M+6uosVGAgABRo6CAAGcNgIAAg0mkgAKyPgCAAF3biQ== Date: Mon, 20 Sep 2021 14:18:15 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: 4977b185-ada7-87cd-2bc4-398262e4cc9b x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [xvHkQ3Rs7V1CFofEhWB+bcy3dlMmX83QuyHHKoulIywVUZZfLnSLr/AMcF93kssB] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a67a4dc3-e250-4711-3daa-08d97c417ce3 x-ms-traffictypediagnostic: DM6PR07MB7259: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hshwhNzuY2hK2pWvJLcNLZdqbvZQ6yLK39sGur7qWwpSct8Pmu8Vz7g1ld8f11qi/Fys4OUpaEAq0V/ZvO2gNiR2wMDtrl2euz6Ro2asmT8TFwgwQN41LNRhz2fhJ1GpWrMiOdzVCk1M9LQR9wuyKbpoKQlCJD9XlhurxMkO+qDemxo/1gEyloisJDOWdgNjD+Eb+Ynnqd11qb2zV36GcThY0QvSc1mzSusgO2WEQAuYDLet1DZk3sUqJu5ii/RvcLc0w6AJXWyfuTqGXr/UwkUHRAy5RzzRYlKc73W0A5lKMuUG3pAVuwjEKbtVPoUzrzn1Gb/q8qIfXL0n/pan6BAsWx00NifMQgV2KVHxKR2usbZ2DxxJo+d4kVUvxrI4UbooSbCwlpYJXNqe56oS870SP1h0w6+fcfVqIH1e3eahS9sax4zUu5lYx87n3xldP/qwXtoFc7t60CLLPy7p41M2iM9tiue5lsHphIEhuDbdPXCrzzimst2RhAp6+Bnnoa9q2ihTsPSIBK0f6hZMYg== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: N5VU1OeljvcPx65rJ538Zl0n1yv7kmgyfvEsClQHIWTLO8bLwg+/g1DkDXwsD85xuJKAZ0m/wXRwRFy1KDvOuW10fndClQhwnYJYm9qo0sXEN3HxiOQzGXezn5C6SfEeVqjlYDwHQmoOziI4bSd05VoIEEF/O4j/0OoaqgBFE1OU6Q4nd/Pnt+XArD1/H27afevSFZpI2H/wEbkclrE8Ow== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-35401.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR07MB6618.namprd07.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: a67a4dc3-e250-4711-3daa-08d97c417ce3 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2021 14:18:15.9241 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB7259 Subject: Re: [PHP-DEV] RFC: Add `final class Vector` to PHP From: tysonandre775@hotmail.com (tyson andre) Hi Peter Bowyer,=0A= =0A= > That is a fair point. Vector is an overloaded and common word. For me a= =0A= > vector will always default to an entity characterized by a magnitude and = a=0A= > direction, because that's what I learned and used for years. The next=0A= > definition I learned was the Numpy one.=0A= > =0A= > That for me is the sticking point if this Vector allows mixed types which= =0A= > include arrays or vectors. Store them inside a Vector and then you end up= =0A= > with a matrix, a tensor and so-on in something identified as a Vector,=0A= > which is nonsense. Yes C++ does that [1]. Yes with generics it sort-of=0A= > makes sense. Numpy gets round it by calling the type `ndarray` and a vect= or=0A= > is a specialised one-dimensional array.=0A= > =0A= > If it's a high-performance array and that's the goal, call it hparray. Ca= ll=0A= > it a tuple. Call it a dictionary.=0A= =0A= - `hparray`: I think putting high performance in any class name in core is = a mistake,=0A= and generally poor naming choice, and will mislead users now or in the fu= ture.=0A= (unless it is literally an API client for a database or server that inclu= des high performance in the server software's name)=0A= =0A= Benchmarks currently show it using less memory but some more time than `a= rray`,=0A= and those benchmarks will change as opcache's internals or PHP's represen= tation =0A= of `object`s or `array`s change.=0A= =0A= Which choice of data structure is highest performance would depend on the= benchmark or needs of the application/library.=0A= - `tuple`: In mathematics, most references I've heard of to tuples are gene= rally =0A= fixed sizes (n-tuples). In programming, python and C++ and various other = languages=0A= use tuple to refer to a fixed-size (and immutable) data structure,=0A= making this naming choice extremely confusing.=0A= https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequenc= es=0A= https://en.cppreference.com/w/cpp/utility/tuple=0A= =0A= > (In C++)Class template std::tuple is a fixed-size collection of heterog= eneous values.=0A= - `dictionary` - Wikipedia refers to this as an associative array https://e= n.wikipedia.org/wiki/Associative_array=0A= which is the exact opposite of what my Vector RFC is proposing.=0A= =0A= So I don't consider any of those proposed names appropriate alternatives, = =0A= and expect much, much stronger opposition to an RFC using that naming choic= e for this functionality.=0A= =0A= I expect opposition to any naming choice I propose; `Vector` is what I expe= ct to have the least opposition.=0A= =0A= Thanks,=0A= Tyson=0A=