Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Tracking: Support CPython extension modules (*.pyd) #296

Open
ironpythonbot opened this issue Dec 9, 2014 · 9 comments
Open

Tracking: Support CPython extension modules (*.pyd) #296

ironpythonbot opened this issue Dec 9, 2014 · 9 comments

Comments

@ironpythonbot
Copy link

This isn't something we're likely to implement soon - there's lots of
challenges in getting this to work. Unfortunately you'll probably not be able
to get it working from C# either, but this might be a great use for C++/CLI
instead. I believe we do have a bug filed against it, we just won't get to it
anytime soon J.

There's two big problems here:

            #1) Re-creating the unmanaged CPython interfaces - this will be no small chore
            #2) Dealing w/ direct access to the raw object layout.  For example I don't believe bumping the ref count goes through an API, instead it just uses a macro which adjusts the raw memory.

#1 is by and large just a matter of someone cranking through and creating

the thunks that map into the IronPython runtime (I'd include the calls into
the PYD's init and other functions as well here). But #2 is a large can of
worms. What probably needs to happen is VirtualAlloc'ing a block of memory as
read-only, setting up an exception handler, and fixing the memory up at
runtime as it's accessed - then when changes happen directly to memory the C#
objects can be updated.

All in all it's a huge project... In the mean time you might be able to find a
.NET library that does the same thing as the PYD and either wrap that in some
Python code if programming against the same API is a must or just program
directly against it if that's not one of your requirements.

Glad you're having a good time with it!

From: users-bounces at lists.ironpython.com [mailto:users-bounces at
lists.ironpython.com] On Behalf Of Josh Cassell
Sent: Tuesday, October 03, 2006 11:14 AM
To: users at lists.ironpython.com
Subject: [IronPython] pyd files

Is there ever going to be a way to import from a .pyd file in IronPython? If
not, is it possible to interop to a .pyd file in C# in order to wrap it for
use from IronPython?

Btw, I'm new to Python, and it has been very enjoyable and exciting using
IronPython. Thanks very much!

Josh

Work Item Details

Original CodePlex Issue: Issue 11333
Status: Active
Reason Closed: Unassigned
Assigned to: Unassigned
Reported on: Jun 25, 2007 at 6:55 PM
Reported by: dfugate
Updated on: Aug 26, 2013 at 11:56 PM
Updated by: Lythie

@ironpythonbot
Copy link
Author

On 2007-06-26 05:51:26 UTC, sborde commented:

We can look into hosting the CPython engine to build an interop bridge without having to deal with the CPython interfaces directly.

@ironpythonbot
Copy link
Author

On 2007-11-02 21:03:38 UTC, fuzzyman commented:

This feature will be added to IronPython by Resolver Systems as an open source project. Some progress has already been made.

Relevant links:

http://www.resolversystems.com/news/?p=17 (project announcement)

http://groups.google.com/group/c-extensions-for-ironpython (mailing list)

http://www.voidspace.org.uk/ironpython/cpython_extensions.shtml (working proof of concept)

@ironpythonbot
Copy link
Author

On 2008-12-02 12:00:04 UTC, TraumaPony commented:

I wish I could vote up more than once for this.

@ironpythonbot
Copy link
Author

On 2008-12-02 19:29:56 UTC, Eloff commented:

You can, Ironclad is open source,
http://code.google.com/p/ironclad/, feel free to contribute.

@ironpythonbot
Copy link
Author

On 2008-12-05 19:56:07 UTC, fuzzyman commented:

Shouldn't this issue be closed? There's no way it will be implemented separately from Ironclad right?

@ironpythonbot
Copy link
Author

On 2013-05-29 04:30:22 UTC, bc3tech commented:

Looks like Ironclad might have worked in the past, but its DLLs are statically referencing IronPython 2.6 and won't work with IP 2.7 :(
Would be great if IP would pull in Ironclad since it looks like it is mostly there as of 2.6 - might just need to recompile against 2.7 IP DLLs

@sopelt
Copy link
Contributor

sopelt commented Jan 23, 2015

FYI: It seem like https://github.com/IronLanguages/ironclad attempts to revive ironclad and support it in IPy 2.7.

@slide slide removed the untriaged label Aug 3, 2016
@macumber
Copy link

macumber commented Jan 6, 2017

Would love to see this implemented.!

@slide
Copy link
Contributor

slide commented Jan 6, 2017

I don't think this will get life in the 2.7 releases, but we could look at it for IronPython 3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants