[IronPython] Announcement: Project to get some CPython C extensions running under IronPython
Paolo Molaro
lupus at ximian.com
Thu Oct 18 19:16:51 CEST 2007
On 10/17/07 Tony Djordjevski wrote:
> > You do need to write C code as the API is a C API. I didn't list in the
> > last mail because the C implementation of these functions is not a
> > difference between the C# impl and the C++ impl of the rest of the code.
> > The dllimport declarations I mentioned above would pinvoke to these C
> > functions.
>
> Those C functions you speak about will need to execute managed code.
>
> So, either way, what needs to be done is to allow "Reverse P/Invoke" or
> some form of DllExport. Assuming this project is successful, native
> C/C++ will have to, at some point, execute managed code.
>
> There are only two ways that I know of that you can accomplish this in .NET:
> 1. C++ Interop
> 2. Modifying a compiled assembly
or 3, the easiest of all: using function pointers in the C code which
the runtimes will generate automatically when passing a delegate
to a p/invoked method.
Besides being trivial compared to both 1 and 2, it works on Mono and it
works on the MS CLR.
Happy hacking!
lupus
--
-----------------------------------------------------------------
lupus at debian.org debian/rules
lupus at ximian.com Monkeys do it better
More information about the Ironpython-users
mailing list