Re: [PHP-DEV] C++ extensions and ext_skel
The only modified file is ext_skel. There's also the addition of a file in ext/skeleton -- skeleton.cpp to go along with skeleton.c. I suppose I could get rid of the .cpp file, make a few changes to skeleton.c and have ext_skel make the proper modifications when it's replacing extname, EXTNAME and whatnot. The changes to config.m4 and Makefile.in are done in ext_skel. J Sascha Schumann wrote: On Thu, 28 Nov 2002, J Smith wrote: A couple of times a month, I get questions about from people looking to use C++ with PHP. Apparently, a lot of people end up reading some post I made to php.dev or something a year or so ago about C++, and although it worked at the time, the procedure I describe has become stale. I messed around a bit with ext_skel and ext/skeleton today and added an option to ext_skel (--cpp) that creates a basic C++ extension rather than the standard C extension. The C++ extension is pretty much the same as the standard C extension, with the exception of some extern C linkage, modifications to config.m4 and Makefile.in and a small C++ class thrown in for fun. Cannot those be unified? - Sascha -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] C++ extensions and ext_skel
AFAIK, PHP is designed to function on any standard ANSI-compatible C compiler (as a goal). Unless this has changed, I don't know if opening the door for C++ development is the best of ideas (IMHO) John -Original Message- From: J Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 28, 2002 5:25 PM To: [EMAIL PROTECTED] Subject: [PHP-DEV] C++ extensions and ext_skel A couple of times a month, I get questions about from people looking to use C++ with PHP. Apparently, a lot of people end up reading some post I C++ made to php.dev or something a year or so ago about C++, and although it worked at the time, the procedure I describe has become stale. I messed around a bit with ext_skel and ext/skeleton today and added an option to ext_skel (--cpp) that creates a basic C++ extension rather than the standard C extension. The C++ extension is pretty much the same as the standard C extension, with the exception of some extern C linkage, modifications to config.m4 and Makefile.in and a small C++ class thrown in for fun. Would this be worth adding to PHP proper? I have patches available for 4.2.3, but if it's worthy, I can whip it up for 4.3 or whatever. It'll save me some email bandwidth if it could be used. J -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] C++ extensions and ext_skel
I think that would be quite cool, save me from having to do it manualy. Shane J Smith wrote: A couple of times a month, I get questions about from people looking to use C++ with PHP. Apparently, a lot of people end up reading some post I made to php.dev or something a year or so ago about C++, and although it worked at the time, the procedure I describe has become stale. I messed around a bit with ext_skel and ext/skeleton today and added an option to ext_skel (--cpp) that creates a basic C++ extension rather than the standard C extension. The C++ extension is pretty much the same as the standard C extension, with the exception of some extern C linkage, modifications to config.m4 and Makefile.in and a small C++ class thrown in for fun. Would this be worth adding to PHP proper? I have patches available for 4.2.3, but if it's worthy, I can whip it up for 4.3 or whatever. It'll save me some email bandwidth if it could be used. J -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] C++ extensions and ext_skel
The door has always been open, as it has always been possible. For instance, the qtdom extension has some C++ components, as does the dotnet extension. This just sort of facilitates the, uh, moving through said door. If you're using ANSI/ISO-compliant (or mostly compliant) C and C++ compilers, like the gcc suite or MSVC++, there shouldn't be any problems. (Famous last words, I know.) I get at least two emails a week about this sort of thing, so clearly there is interest. It seems that everyone who emails me is looking to do it on either a personal basis or for some proprietary extension, so it's not like PHP itself would suddenly become polluted with C++. J John Coggeshall wrote: AFAIK, PHP is designed to function on any standard ANSI-compatible C compiler (as a goal). Unless this has changed, I don't know if opening the door for C++ development is the best of ideas (IMHO) John -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] C++ extensions and ext_skel
I concur, that would be cool. Patches should be against HEAD. George On Thursday, November 28, 2002, at 05:33 PM, Shane Caraveo wrote: I think that would be quite cool, save me from having to do it manualy. Shane J Smith wrote: A couple of times a month, I get questions about from people looking to use C++ with PHP. Apparently, a lot of people end up reading some post I made to php.dev or something a year or so ago about C++, and although it worked at the time, the procedure I describe has become stale. I messed around a bit with ext_skel and ext/skeleton today and added an option to ext_skel (--cpp) that creates a basic C++ extension rather than the standard C extension. The C++ extension is pretty much the same as the standard C extension, with the exception of some extern C linkage, modifications to config.m4 and Makefile.in and a small C++ class thrown in for fun. Would this be worth adding to PHP proper? I have patches available for 4.2.3, but if it's worthy, I can whip it up for 4.3 or whatever. It'll save me some email bandwidth if it could be used. J -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] C++ extensions and ext_skel
Well, Personally I don't have any problem with introducing C++ into PHP so no argument there from me. I'm curious if using C++ as opposed to C would cause a performace hit? John -Original Message- From: J Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 28, 2002 5:43 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DEV] C++ extensions and ext_skel The door has always been open, as it has always been possible. For instance, the qtdom extension has some C++ components, as does the dotnet extension. This just sort of facilitates the, uh, moving through said door. If you're using ANSI/ISO-compliant (or mostly compliant) C and C++ compilers, like the gcc suite or MSVC++, there shouldn't be any problems. (Famous last words, I know.) I get at least two emails a week about this sort of thing, so clearly there is interest. It seems that everyone who emails me is looking to do it on either a personal basis or for some proprietary extension, so it's not like PHP itself would suddenly become polluted with C++. J John Coggeshall wrote: AFAIK, PHP is designed to function on any standard ANSI-compatible C compiler (as a goal). Unless this has changed, I don't know if opening the door for C++ development is the best of ideas (IMHO) John -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] C++ extensions and ext_skel
On Thu, 28 Nov 2002, J Smith wrote: A couple of times a month, I get questions about from people looking to use C++ with PHP. Apparently, a lot of people end up reading some post I made to php.dev or something a year or so ago about C++, and although it worked at the time, the procedure I describe has become stale. I messed around a bit with ext_skel and ext/skeleton today and added an option to ext_skel (--cpp) that creates a basic C++ extension rather than the standard C extension. The C++ extension is pretty much the same as the standard C extension, with the exception of some extern C linkage, modifications to config.m4 and Makefile.in and a small C++ class thrown in for fun. Cannot those be unified? - Sascha -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] C++ extensions and ext_skel
AFAIK, PHP is designed to function on any standard ANSI-compatible C compiler (as a goal). Unless this has changed, I don't know if opening the door for C++ development is the best of ideas (IMHO) That just means that the core and standard extensions need to be written in ISO C and does not preclude C++ extensions (which have existed for some time). - Sascha -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] C++ extensions and ext_skel
There is nothing about using a C++ compiler that makes your code less efficient. The primary determinant is still overwhelmingly the programmer. C++ has *never* gotten in my way when writing extremely efficient programs, and in fact I find it a great help. The flip side is I've seen a lot of hideously inefficient C code. You can write inefficient code in any language. Keep in mind that PHP is a (usually) compile-at-runtime, interpreted language :). John Coggeshall wrote: Well, Personally I don't have any problem with introducing C++ into PHP so no argument there from me. I'm curious if using C++ as opposed to C would cause a performace hit? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] C++ extensions and ext_skel
On Thu, Nov 28, 2002 at 06:41:09PM -0500, John Coggeshall wrote : Well, Personally I don't have any problem with introducing C++ into PHP so no argument there from me. I'm curious if using C++ as opposed to C would cause a performace hit? It's not about performance but about an PHP extension which e.g. binds to a 3rd party library written in C++ . -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php