Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123223 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 5E0C41A009C for ; Sun, 28 Apr 2024 08:22:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1714292579; bh=R73GuDCNUm2IeJs1LyqqqWaUZvJfPktLDRR3jZfvKNI=; h=Date:From:To:Subject:In-Reply-To:References:From; b=d3MScPWIMrBSdhvZgWQ4sFkzozCENMvbP9oiHcilofXvgAJWTwrtQZG/323PH8h3p Maf1F+w7oadeAzDrB86kCUVAkZ92PQ/Jt/TxB4i/SuHbOzpyATV6OzEiw7GpopnCFY C7YOh+0S2bk3aZXaIANfaedzdPvfRfT73uzj25vWL74Xw2h568sy8aEO4VmpQs1mV+ +07jZ9B/o9kgI/CO02TbWwmulUsq/xJLczobITepMXhnJDJhjCcSRfIsgfp2mjcNT0 OEDuLuKtFNcVtkuplDrl/H0FpQF2jhxwnXE3cPDHqI3gz2lrW2x9XfbflvFoimn+fL eWHXqYgiIaxOw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 01AA618005B for ; Sun, 28 Apr 2024 08:22:58 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from wfout3-smtp.messagingengine.com (wfout3-smtp.messagingengine.com [64.147.123.146]) (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 ; Sun, 28 Apr 2024 08:22:57 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.west.internal (Postfix) with ESMTP id 6A4B81C00088 for ; Sun, 28 Apr 2024 04:22:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 28 Apr 2024 04:22:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1714292532; x=1714378932; bh=R73GuDCNUm2IeJs1LyqqqWaUZvJfPktLDRR3jZfvKNI=; b= YBo/1gY5oTD/MzTZo+cidOqQegjE2c41XP66oFGj5JqHi+pxISKusu/IoGGexxKq UCeEEPm8cLdsjmnFsHyAwByUOQCpI8s4MLUmACpI6ODWAYvzysteyDXid2Ym3/KY MtSk2UCZMWefzrCHm5eJ7VoGuGxt8djjnWniNsax1VZg9ay5mRY2vYysrN1CiwFZ QzR23J+PupzIapnkHXOPGS1jwy+IN/ApNmVtc9g94TzZTfSS9rPIZ4PDJFSkOUzj brpG8wMhr9xt+D7SGZE/IpEZpShWZ1Jg2mCgfW9gT5fUHk1zhYN9Yewp3Tv0RrmZ XULZKmYMlD/o7EqjYxX/qw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714292532; x= 1714378932; bh=R73GuDCNUm2IeJs1LyqqqWaUZvJfPktLDRR3jZfvKNI=; b=Y +Bl4WCEHTzhaF89L0O9y4/SX/+XlqBQFPVvYGqVahnDZvL9SlTwP0u98+uroMwWH Pu+6G2zO8nFzCX/VOWhSrc7Ome2ST+wrwiEUG1rE5nzdjzzKlXPsdKxvHckYm9CR JTVyueEgjniUXuni96HNPyhrwpfzKAI6/Ny8pawzohkNcTBRsHbvG97bwVUusFt+ 1VahSAhN3Wc82TSLu6YWTUT7EQ+8OIoGGZS9dteSv/es2Q2cwFJj6mAA0aA+2mIG 6c3H5Jihk9j+LaUe7c7zugogMtazT9jAxNyW47opO9tzoH3n46fLSS2yOy0g1Tjo S0S/4wuhCgowd8qBEJneA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddtgedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvufgfjghfkfggtgfgsehtqh hmtddtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdf uceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpe ehleffteeigfevudetfedugedtudevledugeeugeelheeihfehgfdtkeevvefgleenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprd hphhhpsehrfigvtgdrtghordhukh X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 28 Apr 2024 04:22:11 -0400 (EDT) Date: Sun, 28 Apr 2024 09:19:52 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type User-Agent: K-9 Mail for Android In-Reply-To: References: <18c42fdbb30.2831.17a3710df6d58f02ca570cc47e197a63@interi.co> <0f64523d-d949-75ed-682b-789fc33fa3b2@php.net> Message-ID: Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 28 April 2024 07:02:22 BST, Alexander Pravdin wrote: >Hello everyone=2E To continue the discussion, I'm suggesting an updated >version of my proposal=2E This all sounds very useful =2E=2E=2E but it also sounds like several mont= hs of full-time expert development=2E Before you begin, I think it will be really important to define clearly wh= at use cases you are trying to cater for, and who your audience is=2E Only = then can you define a minimum set of requirements and goals=2E It seems to me that the starting point would be an extension with a decima= l type as an object, and implementations for all the operations you want to= support=2E You'll probably want to define that more clearly than "anything= in the language which takes a float"=2E What might seem like it would be the next step is converting the object to= a "native type", by adding a new case to the zval struct=2E Not only would= this require a large amount of work to start with, it would have an ongoin= g impact on everyone working with the internals=2E I think a lot of the benefits could actually be delivered without it, and = as separate projects:=20 - Optimising the memory performance of the type, using copy-on-write seman= tics rather than eager cloning=2E See Gina's recent thread about "data clas= ses"=2E - Overloading existing functions which accept floats with decimal implemen= tations=2E Could potentially be done in a similar way to operator overloads= and special interfaces like Countable=2E - Convenient syntax for creating decimal values, such as 0=2E2d, declare(d= efault_decimal), or having (decimal) casts affecting the tree of operations= below them rather than just the result=2E This just needs the type to be a= vailable to the compiler, not a new zval type - for instance, anonymous fun= ction syntax creates a Closure object=2E=20 There may be other parts I've not mentioned, but hopefully this illustrate= s the idea that "a native decimal type" doesn't have to be one all-or-nothi= ng project=2E Regards, Rowan Tommins [IMSoP]