[Tutor] Extenting python with C++ without recompilations?

Risto Peränen iamgod@cc.jyu.fi
Wed, 3 Oct 2001 16:05:37 +0300 (EEST)


On Tue, 2 Oct 2001 tutor-request@python.org wrote:
> | everytime you create new type with it the python requires
> | recompilations.  Furthermore, I haven't ever liked doing C++ with
>
> All you need to do is compile your extension module, and relink it (at
> runtime).  You don't need to rebuild python itself.  Python uses
> dlopen() to open new extension modules at run time.

What I ment was if your functions/procedures need to return new types,
which will be returned in multiple others extension modules, the other
modules does need to recompiled, doesn't it?  I mean how could C system use
something without proper interface? Sure I could include all header of
other previous extension modules in my new modules but still many
extension modules need to recompiled if I something in early make modules
is changed.
With C++ I could simple make an interface and changing implementions of
memberfunctions (aka methods) without need for recompilation of other
modules.

Furthermore I would like to make scripting language which is more based on
events and is more restricted than python. Yet making methods internally
with classes sound cool for speed - but it does spend huge amounts of
memory.

> | plain C :) So I really would like to use C++ without any goddamn
> | macros as root language with project.
>
> Alex Martelli is a C++ guru (and Python guru on comp.lang.python) and
> really likes Boost Python for extending Python with C++.  There is
> also swig and other tools to semi-automatically wrap your C/C++ code
> as a python extension module.

Hmm, I'll check out his work

iamgod@st.jyu.fi