simple extension modules with GNU's C#

"Martin v. Löwis" martin at v.loewis.de
Thu May 1 11:38:31 EDT 2003


Ionutz Borcoman wrote:

> I know both C and C++. What I want is to make some extension module
> that doesn't need to be compiled when moving from one platform/python
> version to another. For speed or obfuscating reasons.
> 
> My boss might be happier with Python, if key functions are not visible
> in plain Python code or easily disasambled. 

It's strange that you would use C# then. .NET bytecode is just as easily 
disassembled.

> If there's no other way, I'll go with boost library, but using C#
> would have helped me compile the thing only once.

Python only supports extensions that come as a native function pointer 
for the init function. So you need to provide native function pointers 
somehow (not only for the init function, but also for functions 
implemented in the module). Also, PyObject is a native structure, with 
native API to access it. While it may be possible to create .NET 
wrappers, nobody has done so sofar.

As an alternative, you may consider using the .NET COM bridging, and 
access your code as a COM object.

Regards,
Martin





More information about the Python-list mailing list