Re: RFC: Removing the Zend API
| From: | Johannes Schlüter | Date: | Wed, 01 Apr 2009 16:13:07 +0000 |
| Subject: | Re: RFC: Removing the Zend API | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-43581@lists.php.net to get a copy of this message | ||
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