[Ironpython-users] c# extentions

Jeff Hardy jdhardy at gmail.com
Fri Jul 19 18:40:57 CEST 2013

On Fri, Jul 19, 2013 at 6:35 AM, Pawel Jasinski <pawel.jasinski at gmail.com>wrote:

> hi
> I wonder if anybody already made an equivalent of a module with c#
> extension, analog to c extension in cpython.
> What I am looking for is:
> - a way to structure a package
> - a way to distribute a package (mods to distutil?)
> - how can it coexist with c based extension in the same package
> - should it come as c# source only or with .dll
> - where to put dlls on the target system. For now I have dropped .dll
> into package folder, but I suspect this is not optimal.
> Ideally a package would have a c and c# extension and on both targets
> installs with distutils.
> Any comments are greatly appreciated.

I have a couple of older examples (
https://bitbucket.org/jdhardy/ironpythonzlib/src and
https://bitbucket.org/jdhardy/ironpython.sqlite/src) that show how to
structure them. You could also look at the source for IronPython.Modules.

Whether you can replace a C module depends on how the existing C module
works; Python supports a couple of different uses. Which package are you
trying to support?

If you want distutils to build them, you'll need to extend distutils. Once
nice thing is that .NET/Mono always has a C# compiler available, so that's
totally feasible.

For modules shipped with IronPython they go in the DLLs folder, but that
might not work in all cases.

In general, they're pretty easy to write, but no one has yet explored how
to fit them into the Python packaging ecosystem.

- Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20130719/bb419e87/attachment.html>

More information about the Ironpython-users mailing list