Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81745 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77819 invoked from network); 3 Feb 2015 22:39:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2015 22:39:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wg0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:33943] helo=mail-wg0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/7B-20608-83E41D45 for ; Tue, 03 Feb 2015 17:39:52 -0500 Received: by mail-wg0-f41.google.com with SMTP id a1so47282354wgh.0 for ; Tue, 03 Feb 2015 14:39:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to :message-id; bh=oxTblmRefGBuFMTP3U5fP4CnY4MVwtr4L4s+bENv7kM=; b=ojpSkL6DGOjATERFctTDvlmJTD1GgiwCLNr/YS4vLghsXmt69s+Fht4JC6xEjVQDoo RjMfV/T7khza1GNcpqs8/4RwNOZ/Dh8MHylKEFdwvp5N4p4IyMKgz5KmwkJDL2N8BFUB NXKSaZ0SAeXbWL0So8Ai/hsRssaU5r6ZOOAxunlD+cuNCUNQF0pyUejwtoBCbMqzQDMt yOp2fWPNqaVL4793NlkF/c5EgtmJE8RwjPwU4b+l8kkaZ0+Rlam0Dufl4ZQ8M3uN9ITo TmI3rDTZwhc4qlJTiJzDXqGwN5MCvcLnJBozy9/lx3/hc0exjg5LygiS9eGbCQFnjhe5 xWUg== X-Received: by 10.180.182.8 with SMTP id ea8mr39183979wic.48.1423003189914; Tue, 03 Feb 2015 14:39:49 -0800 (PST) Received: from [100.116.53.143] ([213.205.194.219]) by mx.google.com with ESMTPSA id oo8sm23137263wjc.1.2015.02.03.14.39.48 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 14:39:49 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: <54D14268.3050500@lsces.co.uk> References: <8C47FA53-0964-49C0-963C-332A936348A5@ajf.me> <54D00C40.8060907@lsces.co.uk> <54C5DC93-9600-4EE2-BF06-7BF10FC6AD5C@ajf.me> <54D08D50.5050407@lsces.co.uk> <1C2ED70C-72A0-4513-A134-5DAE4CCA5B3D@ajf.me> <54D0DFE5.9030602@lsces.co.uk> <06F175EB-D44A-445F-8015-8421C7C12F39@ajf.me> <54D14268.3050500@lsces.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Tue, 03 Feb 2015 22:39:44 +0000 To: Lester Caine ,internals@lists.php.net Message-ID: <85032A50-7E7F-40FB-8FEC-D4D185004ACC@gmail.com> Subject: Re: [PHP-DEV] [RFC] Big Integer Support From: rowan.collins@gmail.com (Rowan Collins) On 3 February 2015 21:49:28 GMT, Lester Caine wrote: >On 03/02/15 16:44, Andrea Faulds wrote: >> Sure, but I don’t think we shouldn’t cripple the language merely for >the sake of really low-end embedded devices. Also, I’m not convinced >that the overhead, at least in terms of file size, is really that big >of an issue. > >'I don’t think we should cripple' ? > >There are two views on the handling of integers. Obviously it would be >nice if there was no limit to the size of a number and there are >situations where that is indeed useful. However there are equally >situations where both the natural 32bit and 64bit limits of the target >hardware and software needs to be observed and these require a >different >method of handling things like 'overflow'. Simply automatically >upgrading an integer value to a more complex object depending on what >hardware one is running on adds the overhead of having to create code >to >disable things depending on some hardware flag. > >With the bulk of SQL persistent data having to manage both 32 and 64bit >integer limits and the matching float/numeric limits, a system of >working which mirrors that would naturally seem to be the sensible >default. If those limitations have been avoided by the use of >additional >libraries, then a matching additional library in PHP also comes into >play. > >Currently we have a problem with the size of integers, but simply >ignoring that there are limits is not the may to fix that problem. I don't think a high-level language should expose the details of integer representation of the server you install it on any more than it exposes memory management. A user might need to know limitations of the implementation, but they shouldn't be relying on details of it. Nor should you be relying on your DB server having the same limits as your PHP server, so you'd need to check for 32-bit overflow anyway to install on a 64-bit system. Making the PHP side predictably support arbitrary precision would seem to remove special cases from userland, not add them. It shunts them into C code, which does all sorts of icky low-level stuff we'd like to ignore already. -- Rowan Collins [IMSoP]