Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123268 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 7D0591A009C for ; Sun, 5 May 2024 17:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1714931179; bh=RSo+IBmc43gIsmP10KLM5hQCs5RrLd8pe985mko0uBs=; h=Date:From:To:Subject:In-Reply-To:References:From; b=Fdln+uDAAK4EyHWyK+U+RqRbWmpSI0EzFTBzFpOWt8Rial3+u2jXX7SQajVr9At92 J/ieK60Zr7s/9lpFgBy2mojZgjBPdn40UOk/qkXiBxfMmrvw5VB/r+yqFQzqBSvTZa vGsQCgByYuwV1X+OLKVu+/mvlQNKmhY7dPtIxKgmjtFItlBNM5leLdf4cuiAnU1JsE wiLVDXGpUoKRqOym/cKnp1Rrw8WRQKKE8VDmx4cRauLvlGiKBvsJ+PN9I/iTc9MLKE zUIEJrwqUGd883O/nZbAzg5gtxUdbDTa9ar01LHVqArSHPmo6SdAAAq6wzoUxLAvRD frVYIFeDZXdnA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8E70818002F for ; Sun, 5 May 2024 17:46:18 +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 wfhigh3-smtp.messagingengine.com (wfhigh3-smtp.messagingengine.com [64.147.123.154]) (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, 5 May 2024 17:46:17 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.west.internal (Postfix) with ESMTP id 43B59180007D for ; Sun, 5 May 2024 13:45:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 05 May 2024 13:45:29 -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=1714931128; x=1715017528; bh=RSo+IBmc43gIsmP10KLM5hQCs5RrLd8pe985mko0uBs=; b= DMtQD/PMJYK025LEAZIciSLxMpzzyFAvDqbEnaTD+oP3LYTYU4H5azgUX3QTu93H n1Aykmyhhc43AXponJ0yMdgBpwlkFnsZiwosmg9DzTEpfeT/0rVO3iSW0EmEV7Kp 9uSW6TDjib9wt5u5iRmXjOBVVqUMYr8aOJv2DVETgWKdo2dNTmk2hDWwz8dKlga3 oiSzaOzDvE2JJWUHZLklgNJyTA91J40M90hLJa+MeMFySV11NQDScPa+5kGdguvr qedWf0Tx7yc3TqMA2+8un3mtlwRdylxBuY3aC8MMKmkNpRSLbB1Aq+2lG18DnYIu xK+3yExg1aUIPsgZiPEi8Q== 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=1714931128; x= 1715017528; bh=RSo+IBmc43gIsmP10KLM5hQCs5RrLd8pe985mko0uBs=; b=F KcDW0GXGEoYurAsyz1kOLCPLFmjgiP47q4GOwVeLTM63hez899qL5xSLECnDJ6ng r1EUIYxB6MnLcVYoYWKnuLkziC4kC89pPZy29+3cFUPCuMN5jBSjWHFwDGmp3dfc ikrGFj5hSWnoV1sQ9GfUkHSU4Tl7isUbwSJKYrT2xfdvgAa7/zlTV+osvXMaNoP3 N2wxVsg1FCjtjznwZ86roaamNv3LPqIWKf4Gyp1Y4dRLOiKS83HzdXB8+hwF5pWC UIs0KxtXJZVESTitpmzqtmtn5iOEh4CKjeZGEAMyIEZdDK58mx2GBBjjxAn1f7XA 3LOkn1YPF5r4XT3TMbYpg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvgedguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffufggjfhfkgggtgfesth hqmhdttderjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgn fdcuoehimhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnh epheduhfefiedufeehjeehkeetfeffvddtvdejffefhedufefgffdvveefhfeugeegnecu ffhomhgrihhnpehprggtkhgrghhishhtrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepihhmshhophdrphhhphesrhifvggtrdgtohdr uhhk X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 5 May 2024 13:45:27 -0400 (EDT) Date: Sun, 05 May 2024 10:45:24 -0700 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: <5E8E9FEB-AAFF-4BF8-B5C0-44B1EAAEFF0C@rwec.co.uk> 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 30 April 2024 11:16:20 GMT-07:00, Arvids Godjuks wrote: >I think setting some expectations in the proper context is warranted here= =2E > >1=2E Would a native decimal type be good for the language? I would say we >probably are not going to find many if any people who would be against it= =2E As I said earlier, I don't think that's the right question, because "addin= g a native type" isn't a defined process=2E Better questions are: Should a = decimal type be always available? Does a decimal type need special features= to maximise performance? Should we have special syntax for a decimal type?= What functions should support a decimal type, or have versions which do? >2=2E Is there a need for it? Well, the whole world of e-commerce, account= ing >and all kinds of business systems that deal with money in PHP world do no= t >leave any room for doubt - https://packagist=2Eorg/?query=3Dmoney =2E The= use >case is right there :) That's a great example - would a decimal type make those libraries redunda= nt? Probably not - they provide currency and rounding facilities beyond bas= ic maths=2E Would those libraries benefit from an always-available, high-pe= rformance native type? Certainly=2E=20 Would they benefit from it having strong integration into the syntax and s= tandard library of the language? Not really; there's a small amount of actu= al code dealing with the values=2E >4=2E Is it a lot of engine work? Only if we go for the maximum ambition, highly integrated into the languag= e=2E=20 > Is it worth it?=20 I'm actually not convinced=2E >5=2E But BCMath/GMP/etc!!! Well, extensions are optional=2E Extensions are only optional if we decide they are=2E ext/json used to be = optional, but now it's always-on=2E > They are also not as fast and they deal with strings=2E Not as fast as what? If someone wants to make an extension around a faster= library, they can=2E And only BCMath acts directly on strings; other libra= ries use text input to create a value in memory - whether that's a PHP stri= ng or a literal provided by the compiler doesn't make much difference=2E I absolutely think there are use cases for decimal types and functions; bu= t "I want a faster implementation" and "I want to add a new fundamental typ= e to the language, affecting every corner of the engine" are very different= things=2E Regards, Rowan Tommins [IMSoP]