Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121993 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61346 invoked from network); 12 Dec 2023 21:30:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Dec 2023 21:30:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 26C1718004E for ; Tue, 12 Dec 2023 13:30:39 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-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,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (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 ; Tue, 12 Dec 2023 13:30:38 -0800 (PST) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-28ade227850so271971a91.2 for ; Tue, 12 Dec 2023 13:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702416621; x=1703021421; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wUyxRa0yD257RYBONY3ix8LLh2hnFaSgRmt15xQuig0=; b=eVPvmZacovMygwir9iiNCxSzXrnBEbDuUQLu51tY9ZnPBRlqVSpKpA22BnPEvhRMN+ cNYkTMedQJPQqCkuHXMUksqvJA9F5U+YNZJT58tH9GQqO+bqXfDqzCIQ2fbd3DnmDdrX KZE3tD1JjGwX+Plhu3SY1puXtu10s85JyshjItIhggl83UadH9h/XboXrd2LXU6I1M4s NO6y+waUC1WO+cM6KNM7/xD0tycjy1B6PSK2e25BYr4d0CHJpafBmMovm1izl06XB9jV j9+T9nGIkVUhqUcv/9yKOpSOqMGMM5DXPr2BTL1LcbYAikjBi+SaO4go5mqKEBIXGcwJ Cngg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702416621; x=1703021421; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wUyxRa0yD257RYBONY3ix8LLh2hnFaSgRmt15xQuig0=; b=DT2c70RZYeG2FA40wrT4lw+a/WJbupacxMNn83eZs0hb/NYadZDWwJQX50T6fA+oIc ta9eKFwbNnIaey7T6XEZaMdV7xzfaaRAZXOGCfVohe/iujmrPwh4aVw9lbAGQqAs8l5c 6DJtIaWy1d9ttj6k2DWPk94Ydom5iYNajn3h6MDrfae/5nOIMJahetlmYbEZGu9tuCAq GQJbFnIO+/1sFe8cpgaGQSVGdtx+249jGsK4tDVEUwU1DNfRGVMoX/qOSe0AIfFlkNS2 PHID+4ROMZv3zM6XthDF8nGTtdrlP99+4Z94OTHhq+6aZwcb/rTM9pspDR3GsQuRhPoz Ytbw== X-Gm-Message-State: AOJu0YxBCaoG3vdfzGPDsczC0i9i5WXQFlfX45uLRdCT65HsutekrNey Gxo8dEXqASD3NrolyxgHBH5AjThtKJ7pKwsXjiY= X-Google-Smtp-Source: AGHT+IGZ1MnHclooZMngRNujsNlYcAezxJb/KEwBRvJ8GAE1QlIQDljR7bBI5VIOAMMIuCJqrqG9zB7wiZ1NIojTqZw= X-Received: by 2002:a17:90b:4a49:b0:286:f3ab:72c with SMTP id lb9-20020a17090b4a4900b00286f3ab072cmr5114547pjb.13.1702416621242; Tue, 12 Dec 2023 13:30:21 -0800 (PST) MIME-Version: 1.0 References: <18c42fdbb30.2831.17a3710df6d58f02ca570cc47e197a63@interi.co> In-Reply-To: Date: Tue, 12 Dec 2023 13:30:07 -0800 Message-ID: To: Robert Landers Cc: "G. P. B." , Alexander Pravdin , internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000f81227060c56c12c" Subject: Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type From: jordan.ledoux@gmail.com (Jordan LeDoux) --000000000000f81227060c56c12c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Dec 12, 2023 at 1:00=E2=80=AFPM Robert Landers wrote: > > Hey Gina, > > > GMP supports operator overloading > > GMP kinda-sorta-most-of-the-time supports operator overloading. > Sometimes ... it doesn't. I implemented a field library in PHP (for > work a couple of years ago) and occasionally, overloading would cast > things back to float/int and break the math. I don't have access to > that code, so I don't have any examples readily available (and the > fact that an extension can do overloading but we can't in user-land is > a whole different can of worms which made this library ridiculously > hard to work with -- we rewrote everything in Scala and never looked > back). Needless to say, if I were to go into a project that required > GMP, I wouldn't trust the overloading. > > Just my 2=C2=A2 > I tried not to bring that up in this discussion because it would probably sound bitter/unhelpful, but the lack of userland operator overloading is definitely something that makes a native decimal scalar more necessary. Voters have repeatedly rejected userland operator overloads. The last proposal was mine, and most of the people who voted not told me that they didn't have any real problems with the design, they just don't like operator overloads. Things like ext-decimal and GMP are always going to be clunky and annoying to use without them though. It's one of the reasons I considered writing my own implementation of a decimal scalar for core after my operator overload RFC was declined. The use case for a scalar decimal type is much stronger since nothing like it can be remotely implemented in userland at all. (I know from experience, I wrote from scratch the most comprehensive arbitrary precision math library in PHP.) Jordan --000000000000f81227060c56c12c--