[IronPython] C Extensions

M. David Peterson xmlhacker at gmail.com
Wed Jan 10 19:47:49 CET 2007

On 1/8/07, dwelden <dwoogle at gmail.com> wrote:
> SWIG can generate wrappers for C#. Perhaps that could form the
> foundation for C module wrapping for FePy.

SWIG would be by far and beyond the easiest way to get from point A to point
B in regards to integrating C-based Python extension libraries into the
IronPython mix.  It uses P/Invoke, but with full access to the source
coupled with the fact that the CPython extension libraries can be built on
every major platform, then there really isn't any platform specific issues
to worry about.

Worth making note of, [via the News section @ http://www.swig.org/]

*2006/11/13* SWIG-1.3.30 has been released. This release adds support for R
> and directors for C# amongst a round of bug fixes.

via http://www.swig.org/Doc1.3/CSharp.html#csharp_directors

The SWIG directors feature adds extra code to the generated C# proxy classes
> that enable these classes to be used in cross-language polymorphism.
> Essentially, it enables unmanaged C++ code to call back into managed code
> for virtual methods so that a C# class can derive from a wrapped C++ class.

While this would be of no direct assistance to a C-based library, and
therefore the CPython extension libraries, it does provide some nice
functionality for C++/C# developers to interact with one another, so it
seemed worth mentioning none-the-less.

Also worth noting:  As of Beta 1 of Phalanger 2.0, there is direct support
for Mono.  Not sure how much support is actually provided, or how they went
about integrating the support that is provided, but none-the-less, its there
and might be worth taking a look at in regards to reusing some of their code



M. David Peterson
http://mdavid.name | http://www.oreillynet.com/pub/au/2354
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20070110/7b15b839/attachment.html>

More information about the Ironpython-users mailing list