On Tue, Mar 31, 2009 at 9:23 PM, Nuno Lopes <nlop...@php.net> wrote: > Hi Paul et all, > > I fully understand (and even share) your motivations and goals. However it > seems to me that describing an extension in PHP will lead to loss of > performance, as you cannot capture certain C features in PHP. For example, > there are some internal functions that rely on pointer arithmetic to get > decent performance.
This is not about capturing every C feature. Instead, it is about strictly separating the C and PHP code. If someone wants to C pointer arithmetic, it is simple to code it on the C side of the line. Its not necessary to expose the exact C function from the library. Sometime, you may wish to to have a C function wrapping it, to do some "dirty tricks". > Then you may extend to PHP to better capture these "dirty tricks", and then > you'll end up with some DSL for building PHP extensions. It's not > necessarily bad, it's just a lot of work.. :) This - which I'll call the Pyrex model - is one way to go, but its not my preference. While I think it beats the current model, I hope that it won't be required with whatI propose in the RFC. > Moreover, in your example in the wiki you don't include how you would do > parameter parsing. Or do you rely on the code generator to look at the C > functions signatures and figure out by itself what to do? (actually there is > some ambiguity, AFAIR, and thus guessing cannot be done reliably) That is exactly right. (I'll make this clearer in the RFC). I can't think of any cases where guess cannot be done reliably. If you can give me an example, I'll try and address it. > To summarize my e-mail, I believe this is a very interesting idea, but needs > a lot more thinking :) It's a nice SoC project nethertheless. It certainly does need more thinking, and I'm hoping that people can pick holes in it, so that I can fill them. A SoC project would be ideal, as it would probably expose - and hopefully solve - a great deal of flaws. Thanks for your comments, I'll try and update the RFC in response. Paul > ----- Original Message ----- >> >> Hi, >> >> I've added a new RFC to the wiki >> (http://wiki.php.net/rfc/remove_zend_api). It details a plan to try >> and decouple the Zend engine from the libraries, in order to allow >> large scale changes to the Zend engine in the future. The RFC >> describes a prototype phase of the project, which could reasonably be >> done within a GSOC project, so I have added it to the GSOC 09 page >> (http://wiki.php.net/gsoc/2009#prototyping_removal_of_the_zend_api). >> >> If anybody has any comments, I'd be delighted to hear them. If anybody >> knows (or is) a good student looking for a GSOC project (and I've left >> it late, there are only 3 days left to apply), please encourage the >> student to look at this. Finally, if anybody is interested in helping >> mentor this as part of the GSOC, I'd be grateful for the help (I have >> to start writing my thesis soon). >> >> Thanks, >> Paul > > -- Paul Biggar paul.big...@gmail.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php