Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43581 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36106 invoked from network); 1 Apr 2009 16:13:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Apr 2009 16:13:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 83.243.58.134 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 83.243.58.134 mailout2.netbeat.de Linux 2.6 Received: from [83.243.58.134] ([83.243.58.134:51410] helo=mailout2.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/60-32986-79293D94 for ; Wed, 01 Apr 2009 11:13:12 -0500 Received: (qmail 3498 invoked by uid 89); 1 Apr 2009 16:38:10 -0000 Received: from unknown (HELO ?192.168.1.101?) (johannes%schlueters.de@93.104.122.17) by mailout2.netbeat.de with ESMTPA; 1 Apr 2009 16:38:10 -0000 To: Paul Biggar Cc: Nuno Lopes , PHP Internals In-Reply-To: References: <29CF2C07F9044405AF6332BE2F3A373F@PC3EE1F19287> <1238595978.5733.9.camel@goldfinger> Content-Type: text/plain Date: Wed, 01 Apr 2009 18:13:07 +0200 Message-ID: <1238602387.5733.27.camel@goldfinger> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Removing the Zend API From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Wed, 2009-04-01 at 16:16 +0100, Paul Biggar wrote: > I think that to handle more complex cases we need the kind of > information which makes it straightforward to easily generate code to > make a seamless interface between C and the engine API. The only case > I had thought of was to somehow mangle structs/pointers into > resources. But I suppose we need lengths for strings. I expect (many?) > more of these cases will come up. Well, as soon as any pointer exists you need manual work for a special case. And even when only using integers it's not fully fast-forward: There are cases where not the full integer range is allowed but just a few flags or some specific range. C programmers will know that, passing that 1:1 to PHP userland can be bad. For simple cases http://pecl.php.net/package/ffi might be enough, for average cases there are just a few APIs (PHP_FUNCTION, zend_parse_parameters, RETURN_*) one has to know for a start for an extensions, Hartmut's CodeGen_PECL abstracts that using some XML and then there's PEAR's Inline_C as some "weird" approach. I'd be happy to have some simple toolkit for this, but I guess it's really hard to make some easy tool which really works in average cases not just in proof-of-concept cases. This might also be interesting for other projects like ProjectZero (PHP using a JVM) or pipp (using Parrot) johannes