Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43633 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24425 invoked from network); 6 Apr 2009 09:42:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Apr 2009 09:42:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=rob_nicholson@uk.ibm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rob_nicholson@uk.ibm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain uk.ibm.com designates 194.196.100.161 as permitted sender) X-PHP-List-Original-Sender: rob_nicholson@uk.ibm.com X-Host-Fingerprint: 194.196.100.161 mtagate1.uk.ibm.com Linux 2.5 (sometimes 2.4) (4) Received: from [194.196.100.161] ([194.196.100.161:57717] helo=mtagate1.uk.ibm.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/97-02528-F9EC9D94 for ; Mon, 06 Apr 2009 05:42:56 -0400 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id n369gqkl026583 for ; Mon, 6 Apr 2009 09:42:52 GMT Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n369gqAv3260650 for ; Mon, 6 Apr 2009 10:42:52 +0100 Received: from d06av05.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.13.1/8.13.3) with ESMTP id n369gqne018282 for ; Mon, 6 Apr 2009 03:42:52 -0600 Received: from d06ml069.portsmouth.uk.ibm.com (d06ml069.portsmouth.uk.ibm.com [9.149.38.195]) by d06av05.portsmouth.uk.ibm.com (8.13.1/8.12.11) with ESMTP id n369gpQe018262; Mon, 6 Apr 2009 03:42:52 -0600 In-Reply-To: References: X-Disclaimed: 17418 MIME-Version: 1.0 To: Paul Biggar Cc: PHP Internals X-KeepSent: AF80FC3F:218AFCED-80257590:00297673; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5 November 18, 2008 Message-ID: Date: Mon, 6 Apr 2009 10:42:49 +0100 X-MIMETrack: Serialize by Router on D06ML069/06/M/IBM(Release 8.0.1|February 07, 2008) at 06/04/2009 10:42:51, Serialize complete at 06/04/2009 10:42:51 Content-Type: multipart/alternative; boundary="=_alternative 0034BC5180257590_=" Subject: Re: [PHP-DEV] RFC: Removing the Zend API From: rob_nicholson@uk.ibm.com (Rob Nicholson) --=_alternative 0034BC5180257590_= Content-Type: text/plain; charset="US-ASCII" Paul Biggar wrote on 31/03/2009 00:06:33: > > 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). Hi Paul, This is certainly an interesting project. I work on ProjectZero and I see from the wiki that you have looked at the approach we have taken. As you correctly point out Project Zero wants to allow users to re-use the majority of PHP extensions without re-writing them and as you observe, using the existing interface as we do today brings a number of problems. We would also like to enable others to attach arbitrary PHP extensions written in C to ProjectZero. So we would like to see the "PHP Native Interface" be successful and would like to help if we can. A few of the most significant issues from my perspective: 1. PHP arrays present a significant issue. Look at the code in array.c. Much of this code rummages directly in the internals of the Zend Engine implementation of hashtables and needs to in order to achieve reasonable performance. We were unable to attach this code to a JVM implementation of PHP and rewrote it in Java. Perhaps we will need to accept that the array manipulation functions and a small set of other built-in extensions must continue to use the internal interfaces. Its also worth mentioning that today many extension make use of the Zend HashTable implementation for their own purposes (as a general library function) in addition to using the HashTable as an interface. 2. Memory management. If we separate extensions from the internal implementation of Zvals then it becomes difficult to manage memory allocated by the extension during a request. This "falls out in the wash" today because extensions participate in the Zend engine's reference counting scheme which allows memory to be de-allocated once the refcount falls to zero. 3. A logistical problem seems to me that in order for this project to gain traction a significant number of extensions would need to adopt it. In order for extensions to adopt it, we would need to convince their maintainers that the project had traction. I wonder whether improving the interface could be combined with some of the unicode work so that the resulting porting work for unicode was simpler? Rob Nicholson Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU --=_alternative 0034BC5180257590_=--