Article of interest: Python pros/cons for the enterprise
Jeff Schwab
jeff at schwabcenter.com
Fri Feb 22 14:15:41 EST 2008
Nicola Musatti wrote:
> The real sad thing is that nobody is likely to convince Guido to turn
> CPython into C++Python ;-)
How difficult would that be? Could it be done in stages? I would be
willing to spend some time on that kind of project. Since I know almost
nothing about Python internals, though, I'd appreciate it if a
C++-fluent Python expert could give an estimate in person-months. Also,
what would be the general break-down? Maybe:
(1) Prepare a build environment appropriate for Python, supporting code
in both C and C++. Include unit-test targets, and a mechanism for
module developers to add unit tests to those targets.
(2) Get all the headers C++-clean.
(3) Begin translating one module at a time. Different people could work
on different modules, and add their test-cases to the global target.
One potential problem would be linkage. Would Python-internal C++
modules still have to provide C-linkable APIs, so that they could be
invoked from other parts of Python? A breakdown of module dependencies
would help address this issue, so that it would be clear which parts of
the code-base would be directly affected by translating a given module
to C++.
At the external API level, would it still be important to support
C-style linkage, even if the implementation code isn't written in C? I
don't know whether it's realistic for people embedding Python in non-C++
applications to have to work directly with C++ APIs.
More information about the Python-list
mailing list