Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-06 Thread Stephen J. Turnbull
Anthony == Anthony Baxter [EMAIL PROTECTED] writes: Anthony It's probably worth mentioning that right now, we don't Anthony even come close to compiling with a C++ compiler. A bunch Anthony of the bugs are shallow (casting result from malloc, that Anthony sort of thing) but a

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-05 Thread Wolfgang Langner
Hello, should we perhaps switch to (careful use of) C++ in 3.0 ? I can't see many advantages in moving to C++, but a lot of disadvantages: - Size increase, especially when we start using templates - Performance decrease - Problems with name mangling together with dynamic loading and cross

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-03 Thread Stephen J. Turnbull
martin == martin [EMAIL PROTECTED] writes: martin I don't understand. How can you use a C++ compiler, but martin not the C++ language? An abbreviation for those features that aren't in C. martin As the recent const dilemma shows, C99 and C++98 have, martin unfortunately,

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-03 Thread Anthony Baxter
It's probably worth mentioning that right now, we don't even come close to compiling with a C++ compiler. A bunch of the bugs are shallow (casting result from malloc, that sort of thing) but a bunch more look a tad uglier. Is this something worth trying to fix? Fixing the shallow bugs at least

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-02 Thread Greg Ewing
Fredrik Lundh wrote: someone also pointed out in private mail (I think; it doesn't seem to have made it to this list) that CPython's extensive use of inheritance by aggregation is invalid C. switching to C++ would be one way to address that, of course. A rather heavyweight solution to a

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-02 Thread martin
Zitat von Fredrik Lundh [EMAIL PROTECTED]: I'm not saying Python 3 should be written in C++, I'm only saying that doing so would have not just disadvantages. someone also pointed out in private mail (I think; it doesn't seem to have made it to this list) that CPython's extensive use of

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-02 Thread martin
Zitat von Greg Ewing [EMAIL PROTECTED]: A rather heavyweight solution to a problem that does not seem to have been a problem in practice so far, only in theory. The problem does exist in practice. Python is deliberately build with -fno-strict-aliasing when GCC is used, and might get compiled

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-02 Thread martin
Zitat von Stephen J. Turnbull [EMAIL PROTECTED]: martin - increased type-safety, in particular for API that isn't martin type-checked at all at the moment (e.g. PyArg_ParseTuple) That's merely an advantage to having a C++ *compiler*. No need to actually use the C++ *language*. :-)

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-01 Thread Wolfgang Langner
Hello, should we perhaps switch to (careful use of) C++ in 3.0 ? I can't see many advantages in moving to C++, but a lot of disadvantages: - Size increase, especially when we start using templates - Performance decrease - Problems with name mangling together with dynamic loading and cross

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-01 Thread Barry Warsaw
On Feb 28, 2006, at 6:26 PM, Fredrik Lundh wrote: should we perhaps switch to (careful use of) C++ in 3.0 ? I hope not. It would make life more difficult for embedded/extended users like ourselves because it would force us to link our applications as C++ programs. That introduces lots of

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-01 Thread martin
Zitat von Ulrich Berning [EMAIL PROTECTED]: I can't see many advantages in moving to C++, but a lot of disadvantages: There are a few advantages, though, mainly: - increased type-safety, in particular for API that isn't type-checked at all at the moment (e.g. PyArg_ParseTuple) - more reliable

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-01 Thread Walter Dörwald
[EMAIL PROTECTED] wrote: Zitat von Ulrich Berning [EMAIL PROTECTED]: I can't see many advantages in moving to C++, but a lot of disadvantages: There are a few advantages, though, mainly: - increased type-safety, in particular for API that isn't type-checked at all at the moment (e.g.

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-01 Thread Michael Urman
On 3/1/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: There are a few advantages, though, mainly: - increased type-safety, in particular for API that isn't type-checked at all at the moment (e.g. PyArg_ParseTuple) How would this be accomplished - by a function with a ton of optional

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-01 Thread martin
Zitat von Michael Urman [EMAIL PROTECTED]: On 3/1/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How would this be accomplished - by a function with a ton of optional templated arguments? That's how I would do it. Actually, I would have PyArg_ParseTuple overloaded with different numbers of

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-02-28 Thread Greg Ewing
Fredrik Lundh wrote: should we perhaps switch to (careful use of) C++ in 3.0 ? I worry that if the Python core becomes dependent on C++, it will force all extensions to be written in C++, too. Not only is this inconvenient for people who don't know C++ or prefer not to use it, but I suspect