Friday, May 01, 2009

NWSGI is "a .NET implementation of the Python WSGI specification for IronPython. It is implemented as an ASP.NET HttpHandler for use with IIS 6 and 7" created by Jeff Hardy. The goal is to be able to run Python applications like Django, Trac and Pylons on IronPython. It can also be used on the Microsoft Azure (cloud computing) platform.

This new release is a pre-release which depends on IronPython 2.6 Alpha 1. The following features/changes have been added to NWSGI:

Add "callable" attribute to scriptMapping to specify the callable for that script.

Allow for "virtual" scripts by extending callables to allow for package.module:callable.

This can avoid creating a .wsgi file in many scenarios. This can be used with wildcard mappings by specifying wildcardModule=":callable".

Use the "debug" attribute on system.web/compilation instead of on wsgi.

Jeff Hardy has started an implementation of the Python FFI ctypes for IronPython, written in C#. As more and more standard library modules are implemented using ctypes rather than as traditional C extensions, it is becoming more important to have a working ctypes for IronPython. Even more so as Jython and PyPy both have ctypes - so using ctypes is one way of making extension libraries compatible across different implementations of Python.

Jeff has made what he has done so far available for download, with a fairly big caveat:

Support isn't anywhere close to complete – it passes a whopping 5/101 tests. IronPython 2.6 is required.

What's complete:

Primitive (c_*) types

Simple structures, nested structures

Loading DLLs

Calling functions

byref() parameters

What's missing:

Unions

Subclassed structures

POINTERs

Arrays

Probably lots of other stuff…

It does work for simple functions

Unfortunately (for Jeff), after he announced this on the mailing list Dino Veihland (core IronPython developer) chipped in to say that actually he'd been working on ctypes and intended to include it in IronPython 2.6 - he just hadn't told anyone... Ouch! It was this mixup that prompted the creation of the IronPython 2.6 roadmap - with details of what will be included.