Posts

Showing posts with the label extensions

Catching up with Jeff Hardy and Django on IronPython

Jeff Hardy is an IronPython MVP and a Python community member who has invested a lot of time in getting standard Python libraries available for IronPython. Some of his recent work has been with both Django and the zlib module . It's been a while since we've reported on his work, so this post gets us up to date with what Jeff has been working on: IronPython.Zlib The zlib module is a C extension for Python. Because it is in the Python standard library it is used by many other libraries, like setuptools, making it an important part of the Python infrastructure. Unfortunately not all of the standard library C extensions have been ported to IronPython. The problem of C extensions is one of the major drawbacks of alternative implementations of Python; both Jython and PyPy have the same problem. Even if your code is 'pure-Python' it may not run on alternative implementations if it uses C extensions. For IronPython one solution is to use Ironclad , an open source project cr...

Consuming Extension Methods in IronPython Parts II & III

A while ago Saveen Reddy posted an entry on using extension methods from IronPython . Extension methods allow you to extend types and interfaces in C# by defining new methods in a * different * assembly. IronPython can only see these extension methods if they are decorated with the ExtensionType attribute. This is fine if you have access to the source of the extension methods to and can recompile with this attribute. In part II Saveen shows how you can make the extension methods visible to IronPython without having to modify the assemblies containing the extensions - by creating a third assembly: Consuming Extension Methods in IronPython Part II Part III does some weirder magic using the CodeDom. It allows you to activate the extension methods from inside IronPython without having to create the extra assembly used in Part II. Consuming Extension Methods in IronPython Part III The Isotope.IronPythonUtil is an assembly that contains a method CreateIronPythonExtensionMethodAssembly() C...

NWSGI and subprocess

In the last few days there have been two announcements about modules for IronPython: NWSGI - a 0.1 binary release of a C# WSGI implementation. It comes with a 'Hello World' application, works with simple paste applications and almost works with CherryPy! It is very simple to deploy with IIS 7. Subprocess for IronPython . The subprocess module is one of the biggest gaps in IronPython standard library support (this is the biggest reason that SCons can 't easily be got running on IronPython for example). This implementation (based on System.Diagnostics.Process ) has limitations, but passes around 2/3 of the test suite for subprocess. The good news is that one of the things that Dino was working on during the PyCon sprints, was better subprocess support for Django. The 'soon-to-be-IronPython-commander-in-chief', Harry Pierson, has blogged a simple way to launch the Visual Studio development server for experimenting with NWSGI .

C Extensions for IronPython

A while ago Resolver Systems announced an open source project to get Python C-extensions working with IronPython. The project has been quiet for a while, but now that that the Resolver One 1.0 release is out of the way we can devote more time to it. Fortunately one of our developers (William Reade) went to India over Christmas and spent some time hacking on the beach. He made good progress and has got ' zlib.pyd ' loaded from IronPython and can call into it. He has just posted code and an explanation. The C Extensions for IronPython Mailing List and Group Page (with code download) My Blog Entry on Working on Jumpy with William William's Explanation of Jumpy and its Limitations There is still an enormous amount of work, but not only does the basic approach work - we have the framework of an implementation.

CPython Extensions for IronPython

Based on Python.NET I've got a proof of concept implementation for using CPython extensions from IronPython: CPython Extensions from IronPython It has limitations, but the example code shows using matplotlib (with numpy and Tkinter) from IronPython 2.

C Extensions for IronPython Mailing List

The new Resolver Systems project to allow IronPython to use CPython extensions now has a mailing list: C Extensions for IronPython Mailing List