Integrate Python in a C/C++ application

Cameron Laird claird at lairds.com
Tue May 20 12:54:03 EDT 2003


In article <Cz9xa.185392$K35.4339125 at news2.tin.it>,
Alex Martelli  <aleax at aleax.it> wrote:
			.
			.
			.
>Oh yes!  In particular, I'm really interested in learning
>what makes you think that embedding is gradually becoming
>less important wrt extending -- because I have that
>feeling too but can't really articulate the "why"s.
			.
			.
			.
Social processes and Python's completeness.

My perception is a strong one:  I'm quite convinced this is
true, and objective evidence to the contrary would surpise
(and interest!) me a great deal.  I'd put a big bet on this
one.

It's not for profoundly Pythonic reasons, though; I don't 
think that the type-class reunification was a monumental
breakthrough for embedders, or that the multiple Python
implementations (Jython, Stackless, ...) have somehow stoked
interest in keeping Python "on top".

My first reason, then, has to do with memetics: regression 
to the mean and tipping-point arguments.  As time goes on,
a smaller and smaller proportion of programs have been writ-
ten so as to resist being factored into Python extensions.
Extension's share will continue to expand, just to catch up
with the opportunity.  Also, as we improve the documentation
and capabilities of Python's extensibility, more and more
programmers will get the point that it's feasible.  The 
*idea* has nearly reached "critical mass", so that it can
take over the intellectual landscape.

The second major reason is simply that Python has become 
more complete.  A 1993 designer might reasonably default
to C (or C++), supplemented as necessary.  He wants script-
ability, so he embeds Python.  Would he turn it inside-out,
and instead extend Python?  It's unlikely, because at that
time, it was hard to regard Python as a general-purpose
language.  Ten years later, we can argue that Python is
more general-purpose than C!  People can *see* Python as
the top-level architecture far better than when the library
lacked networking, OS calls, and so on.

There's a serious case to be made here.  I suspect I don't
have the concentration today to make it better than what I
offer above.
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://phaseit.net/claird/home.html




More information about the Python-list mailing list