Most people here won't know me, so I'd like to preface my comments by
saying that I'm by no means a Python evangelist, my primary project
has _way_ more C than Python :-)
On Wed, Apr 28, 2010 at 11:08 PM, Darryl L. Pierce <dpierce(a)redhat.com> wrote:
Therw was some discussion today about converting the Matahari
codebase
over to Python from C++. Since Matahari is fairly young at this point
and not feature rich, it would be a good time to change languages if we
were to do so.
However, in discussing things with Ian, I think that there's not really
that much of an advantage to going from C++ to Python.
I know some are concerned that, with C++, there's the chance that the
code could become hard to maintain.
I'd have thought the reverse.
Particularly given the multitudes of targets we need to support eventually.
I'd expect that Python already handles the most of differences between
Linux and Windows.
And proffered as an advantage of using Python is the speed of
development. Though this is debatable.
A pro in favor of staying with the C++ code is that the QMF framework is
itself being developed primarily in C++ and the Python bindings are a
port based on that C++ code.
This doesn't seem like much of an argument to me.
Parts of Java are a wrapper for C too, but people still use it.
Also speed of execution and reduced
dependencies in using C++ over Python.
True well written C++ will almost always be faster than well written Python.
But I would question whether it actually matters in this case.
Without question there are going to be LOTs of messages flying around
in large deployments, but I'd expect the per-guest numbers to be
relatively low compared to what QMF is used to.
(I guess an implicit assumption here is that only the part on the
guest would be in Python, I don't see a need for any server components
to be Python too)
And even if we speed is going to be critical, can we not just use swig?
Then we still get the speed of QMF's C++ libraries.
But if speed is that big of a factor, I'd be voting for C ;-)
What are everybody's thoughts on this topic? Is there an
advantage to be
gained in switching to Python or should we stay with the C++ codebase?
The Python code for QMF is not yet available, but is scheduled to come
out with F13/RHEL6.
When the suggestion to use Python was first floated, I all but
dismissed it out of hand.
But the more I thought about it, the more it started to make sense.
Using Python would hide most of the differences between platforms and
makes having "plugins" trivial - even in a cross-platform environment.
I can easily imagine a scenario where interested projects provide
Python modules that register their API with matahari at runtime (thus
expanding matahari's capabilities).
My personal (highest to lowest) preference for the client-side
language in this case would be:
Python
C
Fortran
Cobol
Punchcards
C++
:-)