Re: [DRAFT][RFC] Big Integer Support

From: Date: Sat, 21 Jun 2014 11:02:15 +0000
Subject: Re: [DRAFT][RFC] Big Integer Support
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-75027@lists.php.net to get a copy of this message
Hi, An interesting RFC, that could do with some fleshing out. In particular: What is the behaviour when you add 0.5 to a value that is a bigint? What is the behaviour when a bigint zval is used in an extension that is then going to then pass it to an underlying library that is expecting a 64bit value? Will all the extension authors need to start casting and/or checking the values? There are quite a few functions in the GMP library, which presumably are useful in handling bigints. Are these going to be exposed to users? If so, how? Most of all though, it could do with a stronger argument for why handling bigints 'automagically' like this is preferable to handling them explicitly. Without great care for handling them, dealing with very large numbers is still going to fail at some point. Although handling integers as bigints explicitly is more code to write, it's also results in more understandable behaviour, which seems better to me than having more internal converting of types which is not visible in userland. Finally, the RFC should probably address the licensing issues that would be involved in making GMP an integral part of PHP, not just for how PHP is distributed, but also for how people making and distributing PHP applications would be affected. For reference the GMP library is dual-licensed under GNU LGPL v3 and GNU GPL v2.0. As I understand it, these are not compatible with the PHP license. cheers Dan On 20 June 2014 01:35, Andrea Faulds <ajf@ajf.me> wrote: > Good evening again, > > I’ve been working on a patch to add bigints to PHP for more than a fortnight now. It’d > based on the phpng branch and very much unfinished, but is somewhat working. > > A draft RFC is available here: https://wiki.php.net/rfc/bigint > > It’s quite far from done, but I wanted to start some discussion now as finishing the patch > will take some time. > > Thanks! > > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.internals (#75027) next »