Re: first C prototype of PEAR and PEAR_Error
| From: | (Stig Sæther Bakken) | Date: | Sun, 18 Mar 2001 00:01:17 +0000 |
| Subject: | Re: first C prototype of PEAR and PEAR_Error | ||
| References: | 1 2 | Groups: | php.pear.dev php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50@lists.php.net to get a copy of this message | ||
["yavo" <yavo@itena.com.cy>]
> > I've rewritten the PEAR and PEAR_Error classes to C. Check out
>
> Hi stig, I had posted before of an idea to automate creation of C php
> extentions from PEAR classes. Using somthing like phpdoc only to output C
> instead of XML/HTML. The thing is however and this might sound kinda lame,
> I'm not shure whether you can call other PHP functions in a PHP extentions.
> Assuming I'm wring an extention, would I be able to call mysql_connect or
> should I use the mysql libraies to do that.
You can call mysql_connect from such libraries, but it will make sense
to use a lower-level API than the Zend/PHP user-callable function API.
A colleague and I discussed implementing a "PHP to C" compiler for PHP
3 once that was supposed to write C code and compile it in the
background instead of executing it. Our conclusion was that it was
too hairy. Doing it with PHP 4 should be easier though.
The question is how much you would save with such a "PHP to C"
converter. You'd need a lot of optimization in the converter to make
its C code nearly as efficient as the one you'd write by hand (as with
any compiler, really).
If someone is capable of implementing it, please stand up. :-)
- Stig
--
Stig Sæther Bakken <ssb@fast.no>
Fast Search & Transfer ASA, Trondheim, Norway