[Python-3000] Python/C++ question (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Sun Dec 10 10:13:16 CET 2006


Talin schrieb:

A while back someone proposed switching to C++ as the implementation language for CPython, and the response was that this would make ABI compatibility too difficult, since the different C++ compilers don't have a common way to represent things like vtables and such.

This is a lesser issue than it used to be. Today, on Linux, many compilers support a standard ABI (specified originally for IA-64); this ABI is now also part of the Linux Standards Base. The issue also became lesser as the number of "life" C++ implementations got reduced over time. The issue is still real on Windows, where you either use the MS ABI or the GCC ABI.

However, I was thinking - if you remove all of the ABI-breaking features of C++, such as virtual functions, name mangling, RTTI, exceptions, and so on, its still a pretty nice language compared to C - you still have things like namespaces, constructors/destructors (especially nice for stack-local objects), overloadable type conversion, automatic upcasting/downcasting, references, plus you don't have to keep repeating the word 'struct' everywhere.

Most of these are ABI relevant:

Not having to repeat struct has no ABI impact.

Regards, Martin



More information about the Python-3000 mailing list